59 FXMAPTYPE(0, MFXThreadEvent::onThreadEvent),
60 FXMAPFUNC(
SEL_THREAD, 0, MFXThreadEvent::onThreadEvent),
69 FXint res = pipe(event);
74 event = CreateEvent(
nullptr, FALSE, FALSE,
nullptr);
75 FXASSERT(event != NULL);
81 MFXThreadEvent::~MFXThreadEvent() {
83 getApp()->removeInput(event[
PIPE_READ], INPUT_READ);
88 getApp()->removeInput(event, INPUT_READ);
95 void MFXThreadEvent::signal() {
98 FXint res = ::write(event[
PIPE_WRITE], &seltype,
sizeof(seltype));
107 void MFXThreadEvent::signal(FXuint seltype) {
109 FXint res = ::write(event[
PIPE_WRITE], &seltype,
sizeof(seltype));
120 long MFXThreadEvent::onThreadSignal(FXObject*, FXSelector,
void*) {
123 FXint res = ::read(event[
PIPE_READ], &seltype,
sizeof(seltype));
128 handle(
this, FXSEL(seltype, 0),
nullptr);
134 long MFXThreadEvent::onThreadEvent(FXObject*, FXSelector sel,
void*) {
135 FXuint seltype = FXSELTYPE(sel);
136 return target && target->handle(
this, FXSEL(seltype, message),
nullptr);
@ ID_THREAD_EVENT
ID for message passing between threads.
#define UNUSED_PARAMETER(x)
FXDEFMAP(MFXThreadEvent) MFXThreadEventMap[]
FXInputHandle * MFXThreadEventHandle