Leopold Toetsch <[EMAIL PROTECTED]> wrote:
The event handler thread is waiting on a condition, so the only possibility seems to be the latter option, that is run another thread that does nothing but sigwait(3).
While pressing $send_button I realized, that there is another option and - of course - we'll have to handle IO events too.
So my local src/events.c does:
1) block all signals before any thread creation 2) install an event handler for SIGINT 3) start the event handler thread 4) start an IO handler thread, which does: - unblock SIGINT - select in a while loop - if select returns -1, check for EINTR and the sig_atomic_t flag set by the signal handler
All this stuff needs to get out of events.c at some point, and we probably better do it now rather than later. Not because they're not events, but because this behaviour is all very platform-dependent, and so ought to go in the platform-local source instead. (It's not even Unix-dependent, as all the different unix flavors handle signals and threads differently)
What we need to do is get an abstraction in place for this and write platform-specific code to get concrete implementations of that abstraction in place. Which also means we need to have more complex processing of the platform source files.
--
Dan
--------------------------------------"it's like this"------------------- Dan Sugalski even samurai [EMAIL PROTECTED] have teddy bears and even teddy bears get drunk