59 FXMAPTYPE(0, FXThreadEvent::onThreadEvent),
60 FXMAPFUNC(
SEL_THREAD, 0, FXThreadEvent::onThreadEvent),
69 FXint res = pipe(event);
74 event = CreateEvent(
nullptr, FALSE, FALSE,
nullptr);
75 FXASSERT(event != NULL);
81 FXThreadEvent::~FXThreadEvent() {
83 getApp()->removeInput(event[
PIPE_READ], INPUT_READ);
88 getApp()->removeInput(event, INPUT_READ);
95 void FXThreadEvent::signal() {
98 FXint res = ::write(event[
PIPE_WRITE], &seltype,
sizeof(seltype));
107 void FXThreadEvent::signal(FXuint seltype) {
109 FXint res = ::write(event[
PIPE_WRITE], &seltype,
sizeof(seltype));
120 long FXThreadEvent::onThreadSignal(FXObject*, FXSelector,
void*) {
123 FXint res = ::read(event[
PIPE_READ], &seltype,
sizeof(seltype));
128 handle(
this, FXSEL(seltype, 0),
nullptr);
134 long FXThreadEvent::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)
FXInputHandle * FXThreadEventHandle
FXDEFMAP(FXThreadEvent) FXThreadEventMap[]