summaryrefslogtreecommitdiffstats
path: root/cpukit/score/include/rtems/score/coremuteximpl.h
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2016-04-15 21:18:26 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2016-04-21 07:29:39 +0200
commitadbedd10cfe5259018b1682d903ab40f6005b3f0 (patch)
treedde02dde8c5760625667a949661f0bfab266e0dc /cpukit/score/include/rtems/score/coremuteximpl.h
parentposix: Avoid Giant lock for mutexes (diff)
downloadrtems-adbedd10cfe5259018b1682d903ab40f6005b3f0.tar.bz2
score: Introduce _Thread_queue_Flush_critical()
Replace _Thread_queue_Flush() with _Thread_queue_Flush_critical() and add a filter function for customization of the thread queue flush operation. Update #2555.
Diffstat (limited to 'cpukit/score/include/rtems/score/coremuteximpl.h')
-rw-r--r--cpukit/score/include/rtems/score/coremuteximpl.h36
1 files changed, 28 insertions, 8 deletions
diff --git a/cpukit/score/include/rtems/score/coremuteximpl.h b/cpukit/score/include/rtems/score/coremuteximpl.h
index eae6ef16f9..73331a5f32 100644
--- a/cpukit/score/include/rtems/score/coremuteximpl.h
+++ b/cpukit/score/include/rtems/score/coremuteximpl.h
@@ -338,20 +338,40 @@ CORE_mutex_Status _CORE_mutex_Do_surrender(
)
#endif
+Thread_Control *_CORE_mutex_Was_deleted(
+ Thread_Control *the_thread,
+ Thread_queue_Queue *queue,
+ ISR_lock_Context *lock_context
+);
+
+Thread_Control *_CORE_mutex_Unsatisfied_nowait(
+ Thread_Control *the_thread,
+ Thread_queue_Queue *queue,
+ ISR_lock_Context *lock_context
+);
+
/* Must be a macro due to the multiprocessing dependent parameters */
#define _CORE_mutex_Flush( \
the_mutex, \
- status, \
+ filter, \
mp_callout, \
mp_id \
) \
- _Thread_queue_Flush( \
- &( the_mutex )->Wait_queue, \
- ( the_mutex )->operations, \
- status, \
- mp_callout, \
- mp_id \
- )
+ do { \
+ ISR_lock_Context _core_mutex_flush_lock_context; \
+ _Thread_queue_Acquire( \
+ &( the_mutex )->Wait_queue, \
+ &_core_mutex_flush_lock_context \
+ ); \
+ _Thread_queue_Flush_critical( \
+ &( the_mutex )->Wait_queue.Queue, \
+ ( the_mutex )->operations, \
+ filter, \
+ mp_callout, \
+ mp_id, \
+ &_core_mutex_flush_lock_context \
+ ); \
+ } while ( 0 )
/**
* @brief Is mutex locked.