#include <limits.h>
#include <windows.h>
#include "libComAPI.h"
#include "epicsEvent.h"
Go to the source code of this file.
Create an epicsEvent for use from C code, or return NULL.
- Parameters
-
initialState | Starting state, epicsEventEmpty or epicsEventFull . |
- Returns
- An identifier for the new event, or NULL if one not be created.
Definition at line 35 of file osdEvent.c.
40 pSem = malloc (
sizeof ( *pSem ) );
Destroy an epicsEvent and any resources it holds.
No calls to any epicsEventWait routines can be active when this call is made.
- Parameters
-
Definition at line 55 of file osdEvent.c.
57 CloseHandle ( pSem->
handle );
LIBCOM_API void epicsEventShow |
( |
epicsEventId |
id, |
|
|
unsigned |
level |
|
) |
| |
Trigger an event i.e. ensures the next or current call to wait completes.
- Note
- This method may be called from a VxWorks or RTEMS interrupt handler.
- Parameters
-
- Returns
- Status indicator.
Definition at line 64 of file osdEvent.c.
67 status = SetEvent ( pSem->
handle );
Similar to wait() except that if the event is currenly empty the call will return immediately with status epicsEventWaitTimeout
.
- Parameters
-
- Returns
- Status indicator,
epicsEventWaitTimeout
when the event is empty.
Definition at line 123 of file osdEvent.c.
127 status = WaitForSingleObject ( pSem->
handle, 0 );
128 if ( status == WAIT_OBJECT_0 ) {
131 else if ( status == WAIT_TIMEOUT ) {
Wait for an event.
- Note
- Blocks until full.
- Parameters
-
- Returns
- Status indicator.
Definition at line 74 of file osdEvent.c.
77 status = WaitForSingleObject (pSem->
handle, INFINITE);
78 if ( status == WAIT_OBJECT_0 ) {
Wait an the event or until the specified timeout period is over.
- Note
- Blocks until full or timeout.
- Parameters
-
id | The event identifier. |
timeOut | The timeout delay in seconds. |
- Returns
- Status indicator.
Definition at line 89 of file osdEvent.c.
96 if ( timeOut <= 0.0 ) {
99 else if ( timeOut >= INFINITE / mSecPerSec ) {
103 tmo = ( DWORD ) ( ( timeOut * mSecPerSec ) + 0.5 );
108 status = WaitForSingleObject ( pSem->
handle, tmo );
109 if ( status == WAIT_OBJECT_0 ) {
112 else if ( status == WAIT_TIMEOUT ) {
const unsigned mSecPerSec