62 FXMAPTYPE(0, FXThreadEvent::onThreadEvent),
63 FXMAPFUNC(
SEL_THREAD, 0, FXThreadEvent::onThreadEvent),
72 FXint res = pipe(event);
77 event = CreateEvent(
nullptr, FALSE, FALSE,
nullptr);
78 FXASSERT(event != NULL);
84 FXThreadEvent::~FXThreadEvent() {
86 getApp()->removeInput(event[
PIPE_READ], INPUT_READ);
91 getApp()->removeInput(event, INPUT_READ);
98 void FXThreadEvent::signal() {
101 FXint res = ::write(event[
PIPE_WRITE], &seltype,
sizeof(seltype));
110 void FXThreadEvent::signal(FXuint seltype) {
112 FXint res = ::write(event[
PIPE_WRITE], &seltype,
sizeof(seltype));
123 long FXThreadEvent::onThreadSignal(FXObject*, FXSelector,
void*) {
126 FXint res = ::read(event[
PIPE_READ], &seltype,
sizeof(seltype));
131 handle(
this, FXSEL(seltype, 0),
nullptr);
137 long FXThreadEvent::onThreadEvent(FXObject*, FXSelector sel,
void*) {
138 FXuint seltype = FXSELTYPE(sel);
139 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[]