* 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.