diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2017-04-26 14:06:21 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2017-04-26 14:06:21 (GMT) |
commit | a8155b8bd45a4584cf024465e75331a29edda9b8 (patch) | |
tree | 408169a8521ccf3332e14d8317bdf78435ed287e | |
parent | 22a21905e22a2ad6ae86c293bac257eb7db9e68a (diff) | |
download | tcl-a8155b8bd45a4584cf024465e75331a29edda9b8.zip tcl-a8155b8bd45a4584cf024465e75331a29edda9b8.tar.gz tcl-a8155b8bd45a4584cf024465e75331a29edda9b8.tar.bz2 |
Experiment, does this work? Still to be tested: Eliminate variable triggerPipeVal/eventFdVal (just use 'char dummy'), and just read/write 1 byte to triggerEventFd in stead of 8.
tip_458_experiment
Experiment failed: eventfd's always should be read/written 8 bytes.
-rw-r--r-- | unix/tclEpollNotfy.c | 10 | ||||
-rw-r--r-- | unix/tclUnixNotfy.c | 4 |
2 files changed, 5 insertions, 9 deletions
diff --git a/unix/tclEpollNotfy.c b/unix/tclEpollNotfy.c index 5ed5d5d..ed947ab 100644 --- a/unix/tclEpollNotfy.c +++ b/unix/tclEpollNotfy.c @@ -747,20 +747,18 @@ Tcl_WaitForEvent( numFound = PlatformEventsWait(tsdPtr->readyEvents, tsdPtr->maxReadyEvents, timeoutPtr); for (numEvent = 0; numEvent < numFound; numEvent++) { + char dummy; pedPtr = tsdPtr->readyEvents[numEvent].data.ptr; filePtr = pedPtr->filePtr; mask = PlatformEventsTranslate(&tsdPtr->readyEvents[numEvent]); #ifdef HAVE_EVENTFD if (filePtr->fd == tsdPtr->triggerEventFd) { - uint64_t eventFdVal; - i = read(tsdPtr->triggerEventFd, &eventFdVal, sizeof(eventFdVal)); - if ((i != sizeof(eventFdVal)) && (errno != EAGAIN)) { + i = read(tsdPtr->triggerEventFd, &dummy, 1); #else if (filePtr->fd == tsdPtr->triggerPipe[0]) { - char triggerPipeVal; - i = read(tsdPtr->triggerPipe[0], &triggerPipeVal, sizeof(triggerPipeVal)); - if ((i != sizeof(triggerPipeVal)) && (errno != EAGAIN)) { + i = read(tsdPtr->triggerPipe[0], &dummy, 1); #endif + if ((i != 1) && (errno != EAGAIN)) { Tcl_Panic("Tcl_WaitForEvent: " "read from %p->triggerEventFd: %s", (void *)tsdPtr, strerror(errno)); diff --git a/unix/tclUnixNotfy.c b/unix/tclUnixNotfy.c index 5bc753a..c6725c1 100644 --- a/unix/tclUnixNotfy.c +++ b/unix/tclUnixNotfy.c @@ -123,9 +123,7 @@ Tcl_AlertNotifier( #else ThreadSpecificData *tsdPtr = clientData; #if defined(NOTIFIER_EPOLL) && defined(HAVE_EVENTFD) - uint64_t eventFdVal = 1; - if (write(tsdPtr->triggerEventFd, &eventFdVal, - sizeof(eventFdVal)) != sizeof(eventFdVal)) { + if (write(tsdPtr->triggerEventFd, "", 1) != 1) { Tcl_Panic("Tcl_AlertNotifier: unable to write to %p->triggerEventFd", (void *)tsdPtr); #else |