Duckstation/src/common/event.h
kwyxz 31695c4ff7
Haiku port of duckstation libretro core (#716)
* Haiku build 1st attempt

* fix load on Haiku

* Removed debugging flags

* Added a couple ifndef
2020-08-22 13:20:37 +10:00

31 lines
491 B
C++

#pragma once
#include "types.h"
namespace Common {
class Event
{
public:
Event(bool auto_reset = false);
~Event();
void Reset();
void Signal();
void Wait();
bool TryWait(u32 timeout_in_ms);
static void WaitForMultiple(Event** events, u32 num_events);
private:
#ifdef WIN32
void* m_event_handle;
#elif defined(__linux__) || defined(__APPLE__) || defined(__HAIKU__)
int m_pipe_fds[2];
bool m_auto_reset;
#else
#error Unknown platform.
#endif
};
} // namespace Common