54 FXIMPLEMENT(
MFXSingleEventThread, FXObject, MFXSingleEventThreadMap, ARRAYNUMBER(MFXSingleEventThreadMap))
59 : FXObject(), myClient(client) {
63 FXint res = pipe(event);
68 event = CreateEvent(
nullptr, FALSE, FALSE,
nullptr);
69 FXASSERT(event != NULL);
77 myApp->removeInput(event[
PIPE_READ], INPUT_READ);
82 myApp->removeInput(event, INPUT_READ);
92 FXint res = ::write(event[
PIPE_WRITE], &seltype,
sizeof(seltype));
104 FXint res = ::write(event[
PIPE_WRITE], &seltype,
sizeof(seltype));
116 FXint res = ::read(event[
PIPE_READ], &seltype,
sizeof(seltype));
122 handle(
this, sel,
nullptr);
129 myClient->eventOccurred();
143 std::this_thread::sleep_for(std::chrono::milliseconds(ms));
@ ID_THREAD_EVENT
ID for message passing between threads.
#define UNUSED_PARAMETER(x)
long onThreadEvent(FXObject *, FXSelector, void *)
long onThreadSignal(FXObject *, FXSelector, void *)
virtual ~MFXSingleEventThread()
static void sleep(long ms)
FXInputHandle * MFXThreadEventHandle
FXDEFMAP(MFXBaseObject) MFXBaseObjectMap[]