summaryrefslogtreecommitdiffstats
path: root/cpukit/score/include/rtems/score/coresemimpl.h
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2016-04-18 06:23:27 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2016-04-21 07:29:38 +0200
commit90f1265e5dffe0f834ee9c55640a34fd90be8f12 (patch)
tree93be90c5b980b2be8d07eac95a9a50c539888cfa /cpukit/score/include/rtems/score/coresemimpl.h
parentscore: Close barrier object before flush (diff)
downloadrtems-90f1265e5dffe0f834ee9c55640a34fd90be8f12.tar.bz2
score: Fix _CORE_semaphore_Flush()
Use proper CORE_semaphore_Status for _CORE_semaphore_Flush() and _CORE_semaphore_Destroy() operations. Close #2696.
Diffstat (limited to 'cpukit/score/include/rtems/score/coresemimpl.h')
-rw-r--r--cpukit/score/include/rtems/score/coresemimpl.h24
1 files changed, 16 insertions, 8 deletions
diff --git a/cpukit/score/include/rtems/score/coresemimpl.h b/cpukit/score/include/rtems/score/coresemimpl.h
index 79d907c6b4..e0e278843e 100644
--- a/cpukit/score/include/rtems/score/coresemimpl.h
+++ b/cpukit/score/include/rtems/score/coresemimpl.h
@@ -86,12 +86,21 @@ void _CORE_semaphore_Initialize(
uint32_t initial_value
);
-RTEMS_INLINE_ROUTINE void _CORE_semaphore_Destroy(
- CORE_semaphore_Control *the_semaphore
-)
-{
- _Thread_queue_Destroy( &the_semaphore->Wait_queue );
-}
+#define _CORE_semaphore_Destroy( \
+ the_semaphore, \
+ mp_callout, \
+ mp_id \
+) \
+ do { \
+ _Thread_queue_Flush( \
+ &( the_semaphore )->Wait_queue, \
+ ( the_semaphore )->operations, \
+ CORE_SEMAPHORE_WAS_DELETED, \
+ mp_callout, \
+ mp_id \
+ ); \
+ _Thread_queue_Destroy( &( the_semaphore )->Wait_queue ); \
+ } while ( 0 )
RTEMS_INLINE_ROUTINE CORE_semaphore_Status _CORE_semaphore_Do_surrender(
CORE_semaphore_Control *the_semaphore,
@@ -180,14 +189,13 @@ RTEMS_INLINE_ROUTINE CORE_semaphore_Status _CORE_semaphore_Do_surrender(
/* Must be a macro due to the multiprocessing dependent parameters */
#define _CORE_semaphore_Flush( \
the_semaphore, \
- status, \
mp_callout, \
mp_id \
) \
_Thread_queue_Flush( \
&( the_semaphore )->Wait_queue, \
( the_semaphore )->operations, \
- status, \
+ CORE_SEMAPHORE_STATUS_UNSATISFIED_NOWAIT, \
mp_callout, \
mp_id \
)