RTEMS
cpukit
rtems
src
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
25
rtems_status_code
rtems_event_send
(
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
,
49
THREAD_WAIT_CLASS_EVENT
,
50
&lock_context
51
);
52
}
RTEMS_API_Control
Definition:
tasksdata.h:41
_Thread_Get
Thread_Control * _Thread_Get(Objects_Id id, ISR_lock_Context *lock_context)
Gets a thread by its identifier.
Definition:
threadget.c:24
RTEMS_API_Control::Event
Event_Control Event
Definition:
tasksdata.h:43
eventimpl.h
Classic Event Manager Implementation.
_Thread_Control
Definition:
thread.h:725
rtems_status_code
rtems_status_code
This enumeration provides status codes for directives of the Classic API.
Definition:
status.h:82
_Thread_Control::API_Extensions
void * API_Extensions[THREAD_API_LAST+1]
Definition:
thread.h:840
RTEMS_INVALID_ID
This status code indicates that an object identifier was invalid.
Definition:
status.h:106
rtems_id
Objects_Id rtems_id
Values of this type identify an RTEMS object.
Definition:
types.h:99
THREAD_API_RTEMS
Definition:
thread.h:584
threadimpl.h
Inlined Routines from the Thread Handler.
ISR_lock_Context
Local ISR lock context for acquire and release pairs.
Definition:
isrlock.h:65
rtems_event_set
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_event_send
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
THREAD_WAIT_CLASS_EVENT
#define THREAD_WAIT_CLASS_EVENT
Indicates that the thread waits for an event.
Definition:
threadimpl.h:2173
tasksdata.h
Classic Tasks Manager Data Structures.
Generated by
1.8.14