5
Last change
on this file since 631b3c8 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 Support Call to function Enables Locking of Mutex Object |
---|
5 | * @ingroup POSIXAPI |
---|
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/muteximpl.h> |
---|
22 | |
---|
23 | THREAD_QUEUE_OBJECT_ASSERT( POSIX_Mutex_Control, Mutex.Wait_queue ); |
---|
24 | |
---|
25 | int _POSIX_Mutex_Lock_support( |
---|
26 | pthread_mutex_t *mutex, |
---|
27 | bool blocking, |
---|
28 | Watchdog_Interval timeout |
---|
29 | ) |
---|
30 | { |
---|
31 | POSIX_Mutex_Control *the_mutex; |
---|
32 | Thread_queue_Context queue_context; |
---|
33 | Thread_Control *executing; |
---|
34 | |
---|
35 | the_mutex = _POSIX_Mutex_Get( mutex, &queue_context ); |
---|
36 | |
---|
37 | if ( the_mutex == NULL ) { |
---|
38 | return EINVAL; |
---|
39 | } |
---|
40 | |
---|
41 | executing = _Thread_Executing; |
---|
42 | _CORE_mutex_Seize( |
---|
43 | &the_mutex->Mutex, |
---|
44 | executing, |
---|
45 | blocking, |
---|
46 | timeout, |
---|
47 | &queue_context |
---|
48 | ); |
---|
49 | return _POSIX_Mutex_Translate_core_mutex_return_code( |
---|
50 | (CORE_mutex_Status) executing->Wait.return_code |
---|
51 | ); |
---|
52 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.