]> git.pond.sub.org Git - empserver/commit - src/lib/empthread/pthread.c
Make empth_wakeup() and empth_terminate() wake up empth_sleep(), and
authorMarkus Armbruster <armbru@pond.sub.org>
Thu, 8 Feb 2007 11:26:43 +0000 (11:26 +0000)
committerMarkus Armbruster <armbru@pond.sub.org>
Thu, 8 Feb 2007 11:26:43 +0000 (11:26 +0000)
commitcea39829af96700dd083bf6e17593c2b6fce1685
tree85984db75b6b075ef8ad2148652f3421ff9b20bb
parentfe2de3d743e07cc5ac3b932eb106fe473bd1a838
Make empth_wakeup() and empth_terminate() wake up empth_sleep(), and
empth_sleep() return whether that happened:
[EMPTH_LWP] (lwpWakeupSleep): New, factored out of lwpSelect().
[EMPTH_LWP] (lwpSelect): Use it.
[EMPTH_LWP] (lwpWakeup): New.  Call lwpWakeupFd() if sleeping in
lwpSleepFd(), lwpWakeupSleep() if sleeping in lwpSleepUntil().
[EMPTH_LWP] (lwpTerminate, empth_wakeup): Use it rather than
lwpWakeupFd().
[EMPTH_LWP] (lwpWakeupFd): Internal linkage.
[EMPTH_LWP] (lwpSleepUntil): Reset member runtime, so that lwpWakeup()
can test it reliably.  Return how sleep woke up.
[EMPTH_LWP] (empth_sleep): Return value of lwpSleepUntil().
[EMPTH_POSIX] (EMPTH_INTR): New.
[EMPTH_POSIX] (empth_wakeup): Set state to it.
[EMPTH_POSIX] (empth_restorectx): Clear state.
[EMPTH_POSIX] (empth_sleep): Don't re-seleep when state is not clear,
i.e. thread was woken up prematurely.  Return how sleep woke up.
[EMPTH_W32] (empth_sleep): Implement by waiting on hThreadEvent with a
timeout rather than a straight Sleep().  Return how sleep woke up.
include/empthread.h
include/lwp.h
src/lib/empthread/lwp.c
src/lib/empthread/ntthread.c
src/lib/empthread/pthread.c
src/lib/lwp/lwp.c
src/lib/lwp/sel.c