summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src/coremsgclose.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2016-04-26 21:18:52 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2016-05-02 07:46:14 +0200
commit7580995b477dab82163e17e021894f5d982e314f (patch)
tree562047285cc416cca278d00976765a5e04f6c612 /cpukit/score/src/coremsgclose.c
parentposix: Delete POSIX_Message_queue_Control::named (diff)
downloadrtems-7580995b477dab82163e17e021894f5d982e314f.tar.bz2
score: _CORE_message_queue_Close()
Move lock acquire to caller of _CORE_message_queue_Close() to allow state checks during object close operations under lock protection. Ensures deletion safety on uni-processor configuration.
Diffstat (limited to 'cpukit/score/src/coremsgclose.c')
-rw-r--r--cpukit/score/src/coremsgclose.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/cpukit/score/src/coremsgclose.c b/cpukit/score/src/coremsgclose.c
index 7184b11bfa..5b534312e7 100644
--- a/cpukit/score/src/coremsgclose.c
+++ b/cpukit/score/src/coremsgclose.c
@@ -33,29 +33,27 @@ static Thread_Control *_CORE_message_queue_Was_deleted(
}
void _CORE_message_queue_Do_close(
- CORE_message_queue_Control *the_message_queue
+ CORE_message_queue_Control *the_message_queue,
#if defined(RTEMS_MULTIPROCESSING)
- ,
Thread_queue_MP_callout mp_callout,
- Objects_Id mp_id
+ Objects_Id mp_id,
#endif
+ ISR_lock_Context *lock_context
)
{
- ISR_lock_Context lock_context;
/*
* This will flush blocked threads whether they were blocked on
* a send or receive.
*/
- _CORE_message_queue_Acquire( the_message_queue, &lock_context );
_Thread_queue_Flush_critical(
&the_message_queue->Wait_queue.Queue,
the_message_queue->operations,
_CORE_message_queue_Was_deleted,
mp_callout,
mp_id,
- &lock_context
+ lock_context
);
(void) _Workspace_Free( the_message_queue->message_buffers );