summaryrefslogtreecommitdiffstats
path: root/rtemsbsd/include/machine/rtems-bsd-muteximpl.h
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2015-03-24 09:42:28 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2015-03-26 13:53:24 +0100
commit9bfcb86790cea09fe4838bd2d052b336f8431564 (patch)
tree1e3215a06f790f6d7a954784881fcbc892289f8a /rtemsbsd/include/machine/rtems-bsd-muteximpl.h
parentsmp01: New test (diff)
downloadrtems-libbsd-9bfcb86790cea09fe4838bd2d052b336f8431564.tar.bz2
rtems-bsd-mutex: Support priority changes
Diffstat (limited to 'rtemsbsd/include/machine/rtems-bsd-muteximpl.h')
-rw-r--r--rtemsbsd/include/machine/rtems-bsd-muteximpl.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/rtemsbsd/include/machine/rtems-bsd-muteximpl.h b/rtemsbsd/include/machine/rtems-bsd-muteximpl.h
index dfa332b4..79e6ee57 100644
--- a/rtemsbsd/include/machine/rtems-bsd-muteximpl.h
+++ b/rtemsbsd/include/machine/rtems-bsd-muteximpl.h
@@ -131,18 +131,20 @@ static inline void
rtems_bsd_mutex_unlock(rtems_bsd_mutex *m)
{
ISR_lock_Context lock_context;
+ Thread_Control *owner;
int nest_level;
_ISR_lock_ISR_disable_and_acquire(&m->lock, &lock_context);
nest_level = m->nest_level;
+ owner = m->owner;
+
+ BSD_ASSERT(owner == _Thread_Executing);
+
if (__predict_true(nest_level == 0)) {
RBTree_Node *first = _RBTree_First(&m->rivals, RBT_LEFT);
- Thread_Control *owner = m->owner;
int keep_priority;
- BSD_ASSERT(owner == _Thread_Executing);
-
--owner->resource_count;
keep_priority = _Thread_Owns_resources(owner)
|| owner->real_priority == owner->current_priority;