2012-01-31 02:45:53 -08:00
|
|
|
|
|
|
|
// cEvent.h
|
|
|
|
|
|
|
|
// Interfaces to the cEvent object representing an OS-specific synchronization primitive that can be waited-for
|
|
|
|
// Implemented as an Event on Win and as a 1-semaphore on *nix
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-10-03 11:41:19 -07:00
|
|
|
#pragma once
|
2012-01-31 02:45:53 -08:00
|
|
|
#ifndef CEVENT_H_INCLUDED
|
|
|
|
#define CEVENT_H_INCLUDED
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-10-03 11:41:19 -07:00
|
|
|
|
|
|
|
class cEvent
|
|
|
|
{
|
|
|
|
public:
|
2012-01-31 02:45:53 -08:00
|
|
|
cEvent(void);
|
2011-10-03 11:41:19 -07:00
|
|
|
~cEvent();
|
|
|
|
|
2012-01-31 02:45:53 -08:00
|
|
|
void Wait(void);
|
|
|
|
void Set (void);
|
|
|
|
|
2011-10-03 11:41:19 -07:00
|
|
|
private:
|
|
|
|
|
2012-01-31 02:45:53 -08:00
|
|
|
#ifdef _WIN32
|
|
|
|
HANDLE m_Event;
|
|
|
|
#else
|
|
|
|
sem_t * m_Event;
|
2012-01-31 04:10:40 -08:00
|
|
|
bool m_bIsNamed;
|
2012-01-31 02:45:53 -08:00
|
|
|
#endif
|
|
|
|
} ;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif // CEVENT_H_INCLUDED
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|