summaryrefslogtreecommitdiffstats
path: root/rtemsbsd/include/machine/rtems-bsd-muteximpl.h
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2017-01-11 14:01:17 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2017-01-11 14:02:49 +0100
commit36db134f33bce7890d4d51f13395f20dadcf2ec2 (patch)
tree2ab4b4ef445c4eca4a1e3d12892b403d5cb48625 /rtemsbsd/include/machine/rtems-bsd-muteximpl.h
parentrtems-bsd-mutex: Update due to API changes (diff)
downloadrtems-libbsd-36db134f33bce7890d4d51f13395f20dadcf2ec2.tar.bz2
rtems-bsd-mutex: Add SMP lock debug supportfreebsd-9.3
Diffstat (limited to 'rtemsbsd/include/machine/rtems-bsd-muteximpl.h')
-rw-r--r--rtemsbsd/include/machine/rtems-bsd-muteximpl.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/rtemsbsd/include/machine/rtems-bsd-muteximpl.h b/rtemsbsd/include/machine/rtems-bsd-muteximpl.h
index 586a103e..fdad3f12 100644
--- a/rtemsbsd/include/machine/rtems-bsd-muteximpl.h
+++ b/rtemsbsd/include/machine/rtems-bsd-muteximpl.h
@@ -8,7 +8,7 @@
*/
/*
- * Copyright (c) 2014, 2016 embedded brains GmbH. All rights reserved.
+ * Copyright (c) 2014, 2017 embedded brains GmbH. All rights reserved.
*
* embedded brains GmbH
* Dornierstr. 4
@@ -85,6 +85,9 @@ rtems_bsd_mutex_acquire_critical(rtems_bsd_mutex *m,
_Thread_queue_Queue_acquire_critical(&m->queue.Queue,
&m->queue.Lock_stats, &queue_context->Lock_context.Lock_context);
+#if defined(RTEMS_SMP) && defined(RTEMS_DEBUG)
+ m->queue.owner = _SMP_lock_Who_am_I();
+#endif
}
static inline void
@@ -92,6 +95,10 @@ rtems_bsd_mutex_release(rtems_bsd_mutex *m, ISR_Level isr_level,
Thread_queue_Context *queue_context)
{
+#if defined(RTEMS_SMP) && defined(RTEMS_DEBUG)
+ _Assert( _Thread_queue_Is_lock_owner( &m->queue ) );
+ m->queue.owner = SMP_LOCK_NO_OWNER;
+#endif
_Thread_queue_Queue_release_critical(&m->queue.Queue,
&queue_context->Lock_context.Lock_context);
_ISR_Local_enable(isr_level);