1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-02 04:40:29 +02:00
Commit graph

3758 commits

Author SHA1 Message Date
Mikael Djurfeldt
e5a830847e * threads.c, threads.h (scm_cond_init): Undo unintentional API
change.
2002-11-07 13:29:12 +00:00
Marius Vollmer
7edf178eee *** empty log message *** 2002-11-04 15:43:17 +00:00
Marius Vollmer
79796da5b5 (coop_next_runnable_thread): Removed, wich should have happened when
GUILE_ISELECT was hard-wired.
2002-11-04 15:43:00 +00:00
Marius Vollmer
7caa1b0780 *** empty log message *** 2002-11-03 22:09:33 +00:00
Marius Vollmer
3d7f708f21 * __scm.h (USE_THREADS, GUILE_ISELECT): Define when
SCM_DEBUG_DEPRECATED.  Removed their use thru-out Guile.
2002-11-03 22:09:20 +00:00
Marius Vollmer
5dacb21f59 (libguile_la_SOURCES): Added threads.c
(DOT_DOC_FILES): Added threads.doc.
(DOT_X_FILES): Added threads.x.
(EXTRA_libguile_la_SOURCES): Removed threads.c.
(noinst_HEADERS): Added coop-pthreads.c.
(modinclude_HEADERS): Added coop-pthreads.h.
2002-11-03 22:07:57 +00:00
Marius Vollmer
7b3381f44d (scm_integer_expt): Make 0^z == 0 for z != 0. Also for reals. 2002-11-03 21:57:48 +00:00
Marius Vollmer
bb11cbf4eb *** empty log message *** 2002-11-03 17:22:21 +00:00
Marius Vollmer
5d5bd0183e Include "_scm.h" before testing HAVE_UNISTD_H. Thanks to Bill
Schottstaedt!
2002-11-03 17:18:28 +00:00
Marius Vollmer
1d4cbbed6e *** empty log message *** 2002-11-03 17:15:14 +00:00
Marius Vollmer
d57ed70201 (scm_integer_expt): Make 0^z == 0 for z != 0. 2002-11-03 17:13:50 +00:00
Marius Vollmer
7f5b1b7739 *** empty log message *** 2002-11-03 01:02:12 +00:00
Marius Vollmer
845944c3d9 (HAVE_RESTARTABLE_SYSCALLS): Do define even when
SCM_COPT_THREADS is defined.
(SCM_SYSCALL): Use EINTR-expection version when SCM_COPT_THREADS
is defined.
2002-11-03 01:01:43 +00:00
Marius Vollmer
05166e1aac Some harmless renamings of internal stuff.
(create_thread): New, generalized version of
scm_call_with_new_thread.
(scm_call_with_new_thread): Use it.
(scm_spawn_thread): New, use create_thread.
2002-11-03 00:48:41 +00:00
Marius Vollmer
d52f53b1ff *** empty log message *** 2002-11-02 01:09:20 +00:00
Marius Vollmer
0019d6a19d Redone completely, you might start testing it now. 2002-11-02 01:02:35 +00:00
Marius Vollmer
cfe062d097 Include <errno.h< so that SCM_SYSCALL is correctly
defined when HAVE_RESTARTABLE_SYSCALLS is not defined.
(HAVE_RESTARTABLE_SYSCALLS): Do not define when USE_COPT_THREADS
is defined.
2002-11-02 01:01:00 +00:00
Marius Vollmer
c28b0ba254 Closer, but not there. 2002-10-30 20:28:52 +00:00
Marius Vollmer
cf8ea1a3d1 Updated, but still totally unusable. 2002-10-30 10:41:51 +00:00
Marius Vollmer
30f920c30e *** empty log message *** 2002-10-27 20:29:02 +00:00
Marius Vollmer
d97eb496fc * coop-pthreads.h, coop-pthreads.c: New, but unfinished. 2002-10-27 20:26:21 +00:00
Marius Vollmer
dbbaa07cab (signal_cell_handlers, install_handler_data,
scm_delq_spine_x, really_install_handler, install_handler): New
scheme for triggering signal handlers, to simplify take_signal.
(take_signal): Simplified, to avoid race conditions.
(scm_sigaction_for_thread): Use new Scheme.  Validate that thread
hasn't exited yet.
2002-10-27 20:25:17 +00:00
Marius Vollmer
402858a4d3 (scm_async_click): Reset pending_asyncs, handle
signal_asyncs.  Don't set cdr of a non-signal async to #f.
(scm_i_queue_async_cell): Do not check cdr of cell for #f, queue
always.  Set pending_asyncs.
(scm_system_async_mark_for_thread): Check that thread has not
exited.
(scm_unmask_signals, decrease_block): Call scm_async_click after
block_asyncs becomes zero.
2002-10-27 20:22:01 +00:00
Marius Vollmer
1ceead47c4 * __scm.h (SCM_ASYNC_CLICK): Check pending_asyncs instead of
active_asyncs.

* root.h (scm_root_state): Added pending_asyncs and signal_asyncs
fields.
* root.c (root_mark): Mark them.
(make_root): Initialize them.
2002-10-27 20:16:18 +00:00
Marius Vollmer
2132f0d2a5 (hell_mutex): Reimplemented using scm_make_mutex, etc. 2002-10-27 20:13:24 +00:00
Marius Vollmer
1d0bde44b7 Replaced GUILE_ISELECT with
USE_COOP_THREADS.
(scm_internal_select): Define one version for USE_COOP_THREADS and
one for USE_NULL_THREADS.
(scm_init_iselect): Likewise.
2002-10-27 20:13:10 +00:00
Marius Vollmer
b1e945d7ec (scm_cell, scm_double_cell): Also allow USE_COPT_THREADS to not
protect the slot initializers.
2002-10-27 20:13:00 +00:00
Marius Vollmer
e30a0d8565 (scm_init_guile_1): Call scm_init_thread_procs. This is because
threads need to be initialized before the stack, but gsubrs such as
scm_timed_condition_variable_wait can only be created later.
2002-10-27 20:12:51 +00:00
Marius Vollmer
5f05c406d2 * 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.
2002-10-27 20:12:37 +00:00
Marius Vollmer
4b9154e73e * 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.
2002-10-27 20:12:27 +00:00
Marius Vollmer
79cd5b8eda * coop-defs.h (coop_m): Added 'level' field.
(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, struct timespec): Do not
define.
(coop_condition_variable_broadcast): New.

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

* coop.c (coop_new_mutex_init): Initialize level.
(coop_mutex_trylock, coop_mutex_lock, coop_mutex_unlock): maintain
level.
(coop_condition_variable_signal): Renamed to
coop_condition_variable_broadcast and reimplemented in terms of
that.  Thus...
(coop_condition_variable_broadcast): New.
2002-10-27 20:12:07 +00:00
Marius Vollmer
65a23095ab *** empty log message *** 2002-10-21 12:19:08 +00:00
Marius Vollmer
64e00566db Include <time.h>. Also, use <...> for inclusion of system headers. 2002-10-21 12:03:54 +00:00
Marius Vollmer
087ed40df2 *** empty log message *** 2002-10-20 22:59:32 +00:00
Marius Vollmer
6182ceacb4 (SCM_MAKE_VALIDATE_MSG): New. Use it instead of SCM_MAKE_VALIDATE in
lots of places to gove better error messages.  Thanks to Bill
Schottstaedt!
2002-10-20 22:59:01 +00:00
Neil Jerram
0a50eeaadb Auto docstring updates, including soft port enhancement. 2002-10-19 16:33:25 +00:00
Dirk Herrmann
5ec1d2c8e0 * evalext.h, evalext.c (scm_definedp, scm_defined_p): Renamed
scm_definedp to scm_defined_p and deprecated scm_definedp.
2002-10-19 09:07:23 +00:00
Dirk Herrmann
100ae50db2 * async.h, async.c (scm_system_async): Fixed deprecation to work
correctly when deprecated features are excluded.
2002-10-19 08:22:50 +00:00
Marius Vollmer
2794cb5073 *** empty log message *** 2002-10-16 16:33:12 +00:00
Marius Vollmer
028e573c8a (scm_system_async_mark_for_thread): Validate thread argument. 2002-10-16 16:27:46 +00:00
Marius Vollmer
7751157e03 It's scm_t_cond, not scm_t_condvar. 2002-10-16 16:25:45 +00:00
Marius Vollmer
8ef70d1e3c (scm_t_cond): Renamed from scm_t_condvar, which was the wrong name. 2002-10-16 16:10:40 +00:00
Marius Vollmer
5ae37f7114 (scm_i_thread_root): Do not validate argument. 2002-10-16 16:09:22 +00:00
Marius Vollmer
e37d58d53b (scm_init_feature): Don't add 'threads' for USE_NULL_THREADS. 2002-10-16 16:08:03 +00:00
Marius Vollmer
389626c5ec (scm_cell, scm_double_cell): Also allow USE_NULL_THREADS to not
protect the slot initializers.
2002-10-16 16:03:44 +00:00
Marius Vollmer
f6ecc207bf (scm_sigaction_for_thread): It's "USE_THREADS" not "USE_THREAD". 2002-10-16 16:01:22 +00:00
Marius Vollmer
f9b52b7aa5 (noinst_HEADERS): Added null-threads.c.
(modinclude_HEADERS): Added null-threads.h.
2002-10-16 15:59:37 +00:00
Marius Vollmer
212d33ec60 * threads.h: Include null-threads.h when !USE_COOP_THREADS.
* threads.c: Include null-threads.c when !USE_COOP_THREADS.
(scm_init_threads): Use generic type names scm_t_mutex and
scm_t_coop instead of coop_m and coop_t.
2002-10-16 15:57:13 +00:00
Marius Vollmer
3d527b2755 New files. 2002-10-16 15:54:23 +00:00
Marius Vollmer
f774203437 ... but not for guile-procedures.texi since that is created in the build dir. 2002-10-15 12:06:14 +00:00