RTEMS
eventsend.c
Go to the documentation of this file.
1 
8 /*
9  * COPYRIGHT (c) 1989-2007.
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 #ifdef HAVE_CONFIG_H
18 #include "config.h"
19 #endif
20 
21 #include <rtems/rtems/eventimpl.h>
22 #include <rtems/rtems/tasksdata.h>
23 #include <rtems/score/threadimpl.h>
24 
26  rtems_id id,
27  rtems_event_set event_in
28 )
29 {
30  Thread_Control *the_thread;
31  RTEMS_API_Control *api;
32  ISR_lock_Context lock_context;
33 
34  the_thread = _Thread_Get( id, &lock_context );
35 
36  if ( the_thread == NULL ) {
37 #if defined(RTEMS_MULTIPROCESSING)
38  return _Event_MP_Send( id, event_in );
39 #else
40  return RTEMS_INVALID_ID;
41 #endif
42  }
43 
44  api = the_thread->API_Extensions[ THREAD_API_RTEMS ];
45  return _Event_Surrender(
46  the_thread,
47  event_in,
48  &api->Event,
50  &lock_context
51  );
52 }
Thread_Control * _Thread_Get(Objects_Id id, ISR_lock_Context *lock_context)
Gets a thread by its identifier.
Definition: threadget.c:24
Event_Control Event
Definition: tasksdata.h:43
Classic Event Manager Implementation.
rtems_status_code
This enumeration provides status codes for directives of the Classic API.
Definition: status.h:82
void * API_Extensions[THREAD_API_LAST+1]
Definition: thread.h:840
This status code indicates that an object identifier was invalid.
Definition: status.h:106
Objects_Id rtems_id
Values of this type identify an RTEMS object.
Definition: types.h:99
Inlined Routines from the Thread Handler.
Local ISR lock context for acquire and release pairs.
Definition: isrlock.h:65
uint32_t rtems_event_set
This integer type can hold an event set of up to 32 events represented as a bit field.
Definition: event.h:94
rtems_status_code rtems_event_send(rtems_id id, rtems_event_set event_in)
Sends an event set to a task.
Definition: eventsend.c:25
#define THREAD_WAIT_CLASS_EVENT
Indicates that the thread waits for an event.
Definition: threadimpl.h:2173
Classic Tasks Manager Data Structures.