source: rtems/c/src/exec/rtems/inline/tasks.inl @ 80e2c29e

4.104.114.84.95
Last change on this file since 80e2c29e was ac7d5ef0, checked in by Joel Sherrill <joel.sherrill@…>, on 05/11/95 at 17:39:37

Initial revision

  • Property mode set to 100644
File size: 2.2 KB
Line 
1/*  tasks.inl
2 *
3 *  This file contains the static inline implementation of all inlined
4 *  routines in the with RTEMS Tasks Manager.
5 *
6 *  COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
7 *  On-Line Applications Research Corporation (OAR).
8 *  All rights assigned to U.S. Government, 1994.
9 *
10 *  This material may be reproduced by or for the U.S. Government pursuant
11 *  to the copyright license under the clause at DFARS 252.227-7013.  This
12 *  notice must appear in all copies of this file and its derivatives.
13 *
14 *  $Id$
15 */
16
17#ifndef __RTEMS_TASKS_inl
18#define __RTEMS_TASKS_inl
19
20/*PAGE
21 *
22 *  _RTEMS_tasks_Allocate
23 *
24 */
25
26STATIC INLINE Thread_Control *_RTEMS_tasks_Allocate( void )
27{
28  return (Thread_Control *) _Objects_Allocate( &_Thread_Information );
29}
30
31/*PAGE
32 *
33 *  _RTEMS_tasks_Free
34 *
35 */
36
37STATIC INLINE void _RTEMS_tasks_Free (
38  Thread_Control *the_task
39)
40{
41  _Objects_Free( &_Thread_Information, &the_task->Object );
42}
43
44/*PAGE
45 *
46 *  _RTEMS_tasks_Cancel_wait
47 *
48 */
49
50STATIC INLINE void _RTEMS_tasks_Cancel_wait(
51  Thread_Control *the_thread
52)
53{
54  States_Control state;
55  States_Control remote_state;
56
57  state = the_thread->current_state;
58
59  if ( _States_Is_waiting_on_thread_queue( state ) ) {
60    if ( _States_Is_waiting_for_rpc_reply( state ) &&
61          _States_Is_locally_blocked( state ) ) {
62      remote_state = _States_Clear(
63                       STATES_WAITING_FOR_RPC_REPLY | STATES_TRANSIENT,
64                       state
65                     );
66
67      switch ( remote_state ) {
68
69        case STATES_WAITING_FOR_BUFFER:
70          _Partition_MP_Send_extract_proxy( the_thread );
71          break;
72        case STATES_WAITING_FOR_SEGMENT:
73          _Region_MP_Send_extract_proxy( the_thread );
74          break;
75        case STATES_WAITING_FOR_SEMAPHORE:
76          _Semaphore_MP_Send_extract_proxy( the_thread );
77          break;
78        case STATES_WAITING_FOR_MESSAGE:
79          _Message_queue_MP_Send_extract_proxy( the_thread );
80          break;
81      }
82    }
83    _Thread_queue_Extract( the_thread->Wait.queue, the_thread );
84  }
85  else if ( _Watchdog_Is_active( &the_thread->Timer ) )
86    (void) _Watchdog_Remove( &the_thread->Timer );
87}
88
89#endif
90/* end of include file */
Note: See TracBrowser for help on using the repository browser.