* coop.c, iselect.c: Since thread switches are now performed with
authorMikael Djurfeldt <djurfeldt@nada.kth.se>
Fri, 30 Jan 1998 21:07:00 +0000 (21:07 +0000)
committerMikael Djurfeldt <djurfeldt@nada.kth.se>
Fri, 30 Jan 1998 21:07:00 +0000 (21:07 +0000)
commitd186aac642b9860e86e359af9bad471fe06e0c39
treea627688b9911caa4ca73d79e40fab55a5f65cb9e
parent0a1a92ab64ba19079a5031cbbd12186d794b85e6
* coop.c, iselect.c: Since thread switches are now performed with
interrupts masked, we can't use the old mechanism of delivering
signals immediately when they arrive.  Signals must instead be
delivered when the asyncs run *after* the end of the critical
section in scm_internal_select.  But this also means after context
switch so that the signal will be delivered to a different thread.
To avoid this, I have changed the protocol of
coop_wait_for_runnable_thread and friends so that they are allowed
to return the original thread.  So, if a signal arrives during
scm_internal_select, we won't any longer be forced do a context
switch, but can remain in the same thread and deliver the signal
to it.

* coop.c (coop_mutex_init, coop_mutex_lock, coop_mutex_unlock,
coop_condition_variable_init, coop_condition_variable_wait,
coop_condition_variable_signal): Changed return type from `void'
to `int'.  This is to adhere closer to the pthreads interface.
This, in turn, is part of an attempt to provide C versions of the
mutex and condition variable primitives which can be part of a
frontend to COOP or pthreads.

* coop.c (coop_mutex_destroy, coop_condition_variable_wait_mutex,
coop_condition_variable_destroy): New functions.
libguile/coop.c