source: rtems/c/src/exec/rtems/inline/tasks.inl @ 3235ad9

4.104.114.84.95
Last change on this file since 3235ad9 was 3235ad9, checked in by Joel Sherrill <joel.sherrill@…>, on 08/23/95 at 19:30:23

Support for variable length names added to Object Handler. This supports
both fixed length "raw" names and strings from the API's point of view.

Both inline and macro implementations were tested.

  • Property mode set to 100644
File size: 2.3 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#include <rtems/msgmp.h>
21#include <rtems/partmp.h>
22#include <rtems/regionmp.h>
23#include <rtems/semmp.h>
24
25/*PAGE
26 *
27 *  _RTEMS_tasks_Allocate
28 *
29 */
30
31STATIC INLINE Thread_Control *_RTEMS_tasks_Allocate( void )
32{
33  return (Thread_Control *) _Objects_Allocate( &_Thread_Information );
34}
35
36/*PAGE
37 *
38 *  _RTEMS_tasks_Free
39 *
40 */
41
42STATIC INLINE void _RTEMS_tasks_Free (
43  Thread_Control *the_task
44)
45{
46  _Objects_Free( &_Thread_Information, &the_task->Object );
47}
48
49/*PAGE
50 *
51 *  _RTEMS_tasks_Cancel_wait
52 *
53 */
54
55STATIC INLINE void _RTEMS_tasks_Cancel_wait(
56  Thread_Control *the_thread
57)
58{
59  States_Control state;
60  States_Control remote_state;
61
62  state = the_thread->current_state;
63
64  if ( _States_Is_waiting_on_thread_queue( state ) ) {
65    if ( _States_Is_waiting_for_rpc_reply( state ) &&
66          _States_Is_locally_blocked( state ) ) {
67      remote_state = _States_Clear(
68                       STATES_WAITING_FOR_RPC_REPLY | STATES_TRANSIENT,
69                       state
70                     );
71
72      switch ( remote_state ) {
73
74        case STATES_WAITING_FOR_BUFFER:
75          _Partition_MP_Send_extract_proxy( the_thread );
76          break;
77        case STATES_WAITING_FOR_SEGMENT:
78          _Region_MP_Send_extract_proxy( the_thread );
79          break;
80        case STATES_WAITING_FOR_SEMAPHORE:
81          _Semaphore_MP_Send_extract_proxy( the_thread );
82          break;
83        case STATES_WAITING_FOR_MESSAGE:
84          _Message_queue_MP_Send_extract_proxy( the_thread );
85          break;
86      }
87    }
88    _Thread_queue_Extract( the_thread->Wait.queue, the_thread );
89  }
90  else if ( _Watchdog_Is_active( &the_thread->Timer ) )
91    (void) _Watchdog_Remove( &the_thread->Timer );
92}
93
94#endif
95/* end of include file */
Note: See TracBrowser for help on using the repository browser.