* threads.h: Include "coop-pthreads.h" when requested.
authorMarius Vollmer <mvo@zagadka.de>
Sun, 27 Oct 2002 20:12:37 +0000 (20:12 +0000)
committerMarius Vollmer <mvo@zagadka.de>
Sun, 27 Oct 2002 20:12:37 +0000 (20:12 +0000)
commit5f05c406d2a47f1cfa258929068983581280914d
tree0ad02d2f6f8a6677748a1c2fcb75dfeed5aec1a9
parent4b9154e73ee0c6a1ea763599e6f937f01b89745c
* threads.h: Include "coop-pthreads.h" when requested.
(scm_threads_make_mutex, scm_threads_lock_mutex,
scm_threads_unlock_mutex, scm_threads_monitor): Removed, they were
not implemented anyway.
(scm_init_thread_procs, scm_try_mutex,
scm_timed_condition_variable_wait,
scm_broadcast_condition_variable, scm_c_thread_exited_p,
scm_thread_exited_p): New prototypes.
(struct timespec): Define if not already defined.
(scm_t_mutex, scm_mutex_init, scm_mutex_lock, scm_mutex_trylock,
scm_mutex_unlock, scm_mutex_destroy, scm_t_cond, scm_cond_init,
scm_cond_wait, scm_cond_timedwait, scm_cond_signal,
scm_cond_broadcast, scm_cond_destroy): Declarations moved here and
deprecated.

* threads.c: Include <errno.h>.  Include "coop-pthreads.c" when
requested.
(scm_thread_exited_p): New.
(scm_try_mutex, scm_broadcast_condition_variable): Newly
registered procedures.
(scm_wait_condition_variable, scm_timed_wait_condition_variable):
Use the latter as the procedure for "wait-condition-variable",
thus offering a optional timeout parameter to Scheme.
(scm_wait_condition_variable): Implement in terms of
scm_timed_wait_condition_variable.
(scm_mutex_init, scm_mutex_lock, scm_mutex_trylock,
scm_mutex_unlock, scm_mutex_destroy, scm_cond_init,
scm_cond_wait, scm_cond_timedwait, scm_cond_signal,
scm_cond_broadcast, scm_cond_destroy): Implement in terms of
scm_make_mutex, etc, and deprecate.
(scm_init_threads): Do not create smobs, leave this to
scm_threads_init.  Do not include "threads.x" file.
(scm_init_thread_procs): New, include "threads.x" here.

* null-threads.h (scm_null_mutex, scm_null_mutex_init,
scm_null_mutex_lock, scm_null_mutex_unlock,
scm_null_mutex_destroy, scm_null_condvar, scm_null_condvar_init,
scm_null_condvar_wait, scm_null_condvar_signal,
scm_null_condvar_destroy): Removed.
(scm_mutex_init, scm_mutex_lock, scm_mutex_unlock, scm_cond_init,
scm_cond_wait, scm_cond_signal, scm_cond_broadcast,
scm_cond_destory): Do not define, they are now deprecated and
handled by threads.{h,c}.

* null-threads.c (scm_null_mutex, scm_null_cond): Define here.
(scm_threads_init): Create smobs here, using the appropriate
sizes.
(block): Removed, now unused.
(scm_c_thread_exited_p): New.
(scm_null_mutex_init, scm_null_mutex_lock, scm_null_mutex_unlock,
scm_null_mutex_destroy, scm_null_condvar_init,
scm_null_condvar_wait, scm_null_condvar_signal,
scm_null_condvar_destroy): Removed and updated users to do their
task directly.
(scm_try_mutex, timeval_subtract,
scm_timed_wait_condition_variable,
scm_broadcast_condition_variable): New.
(scm_wait_condition_variable): Removed.

* coop-threads.c (scm_threads_init): Create smobs here, using the
appropriate sizes.
(scm_c_thread_exited_p, scm_try_mutex,
scm_timed_wait_condition_variable,
scm_broadcast_condition_variable): New.
(scm_wait_condition_variable): Removed.
libguile/threads.c
libguile/threads.h