![]() |
![]() |
|
Index
Source Files
Annotated Class List
Alphabetical Class List
Class Hierarchy
Graphical Class Hierarchy
|
||
![]() |
![]() |
#include <Event.h>
Public Member Functions | |
| Event () | |
| ~Event () | |
| void | signal () |
| void | wait (double s) |
Private Attributes | |
| pthread_cond_t | m_event |
| pthread_mutex_t | m_mutex |
Definition at line 37 of file Event.h.
|
|
Definition at line 40 of file Event.h. References m_event.
00041 {
00042 #ifdef _MSC_VER
00043 m_event = CreateEvent( 0, false, false, 0 );
00044 #else
00045 pthread_mutex_init( &m_mutex, 0 );
00046 pthread_cond_init( &m_event, 0 );
00047 #endif
00048 }
|
|
|
Definition at line 50 of file Event.h. References m_event.
00051 {
00052 #ifdef _MSC_VER
00053 CloseHandle( m_event );
00054 #else
00055 pthread_cond_destroy( &m_event );
00056 pthread_mutex_destroy( &m_mutex );
00057 #endif
00058 }
|
|
|
Definition at line 60 of file Event.h. References m_event. Referenced by FIX::Queue< T >::signal().
00061 {
00062 #ifdef _MSC_VER
00063 SetEvent( m_event );
00064 #else
00065 pthread_mutex_lock( &m_mutex );
00066 pthread_cond_broadcast( &m_event );
00067 pthread_mutex_unlock( &m_mutex );
00068 #endif
00069 }
|
|
|
Definition at line 71 of file Event.h. References m_event. Referenced by FIX::Queue< T >::wait().
00072 {
00073 #ifdef _MSC_VER
00074 WaitForSingleObject( m_event, (long)(s * 1000) );
00075 #else
00076 pthread_mutex_lock( &m_mutex );
00077 timespec time, remainder;
00078 double intpart;
00079 time.tv_nsec = (long)(modf(s, &intpart) * 1e9);
00080 time.tv_sec = (int)intpart;
00081 pthread_cond_timedwait( &m_event, &m_mutex, &time );
00082 pthread_mutex_unlock( &m_mutex );
00083 #endif
00084 }
|
|
|
|
|
|
|
1.3.6-20040222 written by Dimitri van Heesch,
© 1997-2001