1 | /** |
---|
2 | * @brief _Thread_queue_Extract_with_proxy |
---|
3 | * |
---|
4 | * This routine extracts the_thread from the_thread_queue |
---|
5 | * and ensures that if there is a proxy for this task on |
---|
6 | * another node, it is also dealt with. A proxy is a data |
---|
7 | * data that is on the thread queue on the remote node and |
---|
8 | * acts as a proxy for the local thread. If the local thread |
---|
9 | * was waiting on a remote operation, then the remote side |
---|
10 | * of the operation must be cleaned up. |
---|
11 | */ |
---|
12 | |
---|
13 | /* |
---|
14 | * COPYRIGHT (c) 1989-2012. |
---|
15 | * On-Line Applications Research Corporation (OAR). |
---|
16 | * |
---|
17 | * The license and distribution terms for this file may be |
---|
18 | * found in the file LICENSE in this distribution or at |
---|
19 | * http://www.rtems.org/license/LICENSE. |
---|
20 | */ |
---|
21 | |
---|
22 | #if HAVE_CONFIG_H |
---|
23 | #include "config.h" |
---|
24 | #endif |
---|
25 | |
---|
26 | #include <rtems/score/threadqimpl.h> |
---|
27 | #include <rtems/score/objectimpl.h> |
---|
28 | #include <rtems/score/statesimpl.h> |
---|
29 | |
---|
30 | bool _Thread_queue_Extract_with_proxy( |
---|
31 | Thread_Control *the_thread |
---|
32 | ) |
---|
33 | { |
---|
34 | States_Control state; |
---|
35 | |
---|
36 | state = the_thread->current_state; |
---|
37 | |
---|
38 | if ( _States_Is_waiting_on_thread_queue( state ) ) { |
---|
39 | #if defined(RTEMS_MULTIPROCESSING) |
---|
40 | if ( _States_Is_waiting_for_rpc_reply( state ) && |
---|
41 | _States_Is_locally_blocked( state ) ) { |
---|
42 | Objects_Information *the_information; |
---|
43 | Objects_Thread_queue_Extract_callout proxy_extract_callout; |
---|
44 | |
---|
45 | the_information = _Objects_Get_information_id( the_thread->Wait.id ); |
---|
46 | proxy_extract_callout = |
---|
47 | (Objects_Thread_queue_Extract_callout) the_information->extract; |
---|
48 | |
---|
49 | if ( proxy_extract_callout ) |
---|
50 | (*proxy_extract_callout)( the_thread ); |
---|
51 | } |
---|
52 | #endif |
---|
53 | _Thread_queue_Extract( the_thread->Wait.queue, the_thread ); |
---|
54 | |
---|
55 | return true; |
---|
56 | } |
---|
57 | return false; |
---|
58 | } |
---|