![]() |
Portable implementation of an event/conditional mutex. More...
#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 |
Portable implementation of an event/conditional mutex.
Definition at line 37 of file Event.h.
FIX::Event::Event | ( | ) | [inline] |
FIX::Event::~Event | ( | ) | [inline] |
void FIX::Event::signal | ( | ) | [inline] |
Definition at line 60 of file Event.h.
References m_event, and m_mutex.
Referenced by FIX::Queue< T >::signal().
void FIX::Event::wait | ( | double | s | ) | [inline] |
Definition at line 71 of file Event.h.
References m_event, and m_mutex.
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 }
pthread_cond_t FIX::Event::m_event [private] |
pthread_mutex_t FIX::Event::m_mutex [private] |