source: rtems/cpukit/score/src/threadqextractwithproxy.c @ 62181b21

4.115
Last change on this file since 62181b21 was b8fa5013, checked in by Joel Sherrill <joel.sherrill@…>, on 10/10/12 at 21:44:14

threadqextractwithproxy.c: Doxygen header and spacing

  • Property mode set to 100644
File size: 1.8 KB
Line 
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.com/license/LICENSE.
20 */
21
22#if HAVE_CONFIG_H
23#include "config.h"
24#endif
25
26#include <rtems/system.h>
27#include <rtems/score/chain.h>
28#include <rtems/score/isr.h>
29#include <rtems/score/object.h>
30#include <rtems/score/states.h>
31#include <rtems/score/thread.h>
32#include <rtems/score/threadq.h>
33#include <rtems/score/tqdata.h>
34
35bool _Thread_queue_Extract_with_proxy(
36  Thread_Control       *the_thread
37)
38{
39  States_Control        state;
40
41  state = the_thread->current_state;
42
43  if ( _States_Is_waiting_on_thread_queue( state ) ) {
44    #if defined(RTEMS_MULTIPROCESSING)
45      if ( _States_Is_waiting_for_rpc_reply( state ) &&
46           _States_Is_locally_blocked( state ) ) {
47        Objects_Information                  *the_information;
48        Objects_Thread_queue_Extract_callout  proxy_extract_callout;
49
50        the_information = _Objects_Get_information_id( the_thread->Wait.id );
51        proxy_extract_callout =
52          (Objects_Thread_queue_Extract_callout) the_information->extract;
53
54        if ( proxy_extract_callout )
55          (*proxy_extract_callout)( the_thread );
56      }
57    #endif
58    _Thread_queue_Extract( the_thread->Wait.queue, the_thread );
59
60    return true;
61  }
62  return false;
63}
Note: See TracBrowser for help on using the repository browser.