summaryrefslogtreecommitdiffstats
path: root/rtemsbsd/include/machine/rtems-bsd-muteximpl.h
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2016-08-11 09:01:42 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2016-08-11 12:37:16 +0200
commit691ed15cba6525fd5777aeb16a0de458568a85a5 (patch)
treeeaddcc8b244ce41a913317dac8305d626df4946b /rtemsbsd/include/machine/rtems-bsd-muteximpl.h
parente1000phy: Provide local support for Marvell's 88E1512 PHY. (diff)
downloadrtems-libbsd-691ed15cba6525fd5777aeb16a0de458568a85a5.tar.bz2
rtems-bsd-mutex: Use _Thread_queue_Surrender()
Diffstat (limited to 'rtemsbsd/include/machine/rtems-bsd-muteximpl.h')
-rw-r--r--rtemsbsd/include/machine/rtems-bsd-muteximpl.h13
1 files changed, 7 insertions, 6 deletions
diff --git a/rtemsbsd/include/machine/rtems-bsd-muteximpl.h b/rtemsbsd/include/machine/rtems-bsd-muteximpl.h
index 4175190a..4a871be0 100644
--- a/rtemsbsd/include/machine/rtems-bsd-muteximpl.h
+++ b/rtemsbsd/include/machine/rtems-bsd-muteximpl.h
@@ -48,11 +48,15 @@
#include <rtems/bsd/sys/lock.h>
#include <rtems/score/threadimpl.h>
+#include <rtems/score/threadqimpl.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
+#define RTEMS_BSD_MUTEX_TQ_OPERATIONS \
+ &_Thread_queue_Operations_priority_inherit
+
static inline void
rtems_bsd_mutex_init(struct lock_object *lock, rtems_bsd_mutex *m,
struct lock_class *class, const char *name, const char *type, int flags)
@@ -122,10 +126,6 @@ rtems_bsd_mutex_trylock(struct lock_object *lock, rtems_bsd_mutex *m)
return (success);
}
-void rtems_bsd_mutex_unlock_more(rtems_bsd_mutex *m, Thread_Control *owner,
- int keep_priority, Thread_queue_Heads *heads,
- Thread_queue_Context *queue_context);
-
static inline void
rtems_bsd_mutex_unlock(rtems_bsd_mutex *m)
{
@@ -163,8 +163,9 @@ rtems_bsd_mutex_unlock(rtems_bsd_mutex *m)
if (__predict_true(heads == NULL && keep_priority)) {
_Thread_queue_Release(&m->queue, &queue_context.Lock_context);
} else {
- rtems_bsd_mutex_unlock_more(m, owner, keep_priority,
- heads, &queue_context);
+ _Thread_queue_Surrender(&m->queue.Queue,
+ RTEMS_BSD_MUTEX_TQ_OPERATIONS, heads, owner,
+ keep_priority, &queue_context);
}
} else {