5
Last change
on this file since 0e16fa45 was
631b3c8,
checked in by Sebastian Huber <sebastian.huber@…>, on 05/23/16 at 09:40:18
|
score: Move thread queue MP callout to context
Drop the multiprocessing (MP) dependent callout parameter from the
thread queue extract, dequeue, flush and unblock methods. Merge this
parameter with the lock context into new structure Thread_queue_Context.
This helps to gets rid of the conditionally compiled method call
helpers.
|
-
Property mode set to
100644
|
File size:
1.1 KB
|
Line | |
---|
1 | /** |
---|
2 | * @file |
---|
3 | * |
---|
4 | * @brief Remove a Message Queue |
---|
5 | * @ingroup POSIX_MQUEUE Message Queues |
---|
6 | */ |
---|
7 | |
---|
8 | /* |
---|
9 | * COPYRIGHT (c) 1989-2014. |
---|
10 | * On-Line Applications Research Corporation (OAR). |
---|
11 | * |
---|
12 | * The license and distribution terms for this file may be |
---|
13 | * found in the file LICENSE in this distribution or at |
---|
14 | * http://www.rtems.org/license/LICENSE. |
---|
15 | */ |
---|
16 | |
---|
17 | #if HAVE_CONFIG_H |
---|
18 | #include "config.h" |
---|
19 | #endif |
---|
20 | |
---|
21 | #include <rtems/posix/mqueueimpl.h> |
---|
22 | |
---|
23 | /* |
---|
24 | * 15.2.2 Remove a Message Queue, P1003.1b-1993, p. 276 |
---|
25 | */ |
---|
26 | |
---|
27 | int mq_unlink( |
---|
28 | const char *name |
---|
29 | ) |
---|
30 | { |
---|
31 | POSIX_Message_queue_Control *the_mq; |
---|
32 | Objects_Get_by_name_error error; |
---|
33 | Thread_queue_Context queue_context; |
---|
34 | |
---|
35 | _Objects_Allocator_lock(); |
---|
36 | |
---|
37 | the_mq = _POSIX_Message_queue_Get_by_name( name, NULL, &error ); |
---|
38 | if ( the_mq == NULL ) { |
---|
39 | _Objects_Allocator_unlock(); |
---|
40 | rtems_set_errno_and_return_minus_one( _POSIX_Get_by_name_error( error ) ); |
---|
41 | } |
---|
42 | |
---|
43 | _POSIX_Message_queue_Namespace_remove( the_mq ); |
---|
44 | |
---|
45 | _CORE_message_queue_Acquire( &the_mq->Message_queue, &queue_context ); |
---|
46 | |
---|
47 | the_mq->linked = false; |
---|
48 | _POSIX_Message_queue_Delete( the_mq, &queue_context ); |
---|
49 | |
---|
50 | _Objects_Allocator_unlock(); |
---|
51 | return 0; |
---|
52 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.