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

3774 commits

Author SHA1 Message Date
Marius Vollmer
340c49bf2c (libguile_la_SOURCES): Removed iselect.c.
(noinst_HEADERS): Removed coop-threads.c, coop-threads.h, coop.c,
null-threads.c, coop-pthreads.c.
(modinclude_HEADERS): Removed coop-defs.h, coop-pthreads.h.  Added
pthread-threads.h.
2002-12-02 00:58:42 +00:00
Marius Vollmer
aeb08e9b18 (scm_init_guile_1): Do not call scm_init_iselect, which has been lost
in the reorganization.
2002-12-02 00:54:11 +00:00
Mikael Djurfeldt
504d99c5f8 * eval.h (scm_t_trampoline_1, scm_t_trampoline_2): New types.
* eval.c, eval.h (scm_trampoline_1, scm_trampoline_2): New functions.

* eval.c (call_subr2_2, call_lsubr_2, call_closure_2): New functions;
(map, for-each): Handle also application on two args as a special
case; Use trampolines.

* sort.c (scm_cmp_function): Choose subr2less for scm_tc7_subr_2o;
(subr2oless): Removed.
(scm_restricted_vector_sort_x): Use scm_return_first to keep the
vector GC protected.

* eval.c (check_map_args): Use scm_out_of_range_pos instead of
scm_out_of_range.
2002-12-01 13:09:26 +00:00
Dirk Herrmann
63dd3413f3 * evalext.[ch] (scm_m_undefine, undefine): Deprecated. 2002-11-24 18:21:48 +00:00
Mikael Djurfeldt
4ba5f279f0 * debug.c (scm_make_iloc): Added missing "return". 2002-11-17 22:18:51 +00:00
Marius Vollmer
56ae231fbe *** empty log message *** 2002-11-17 10:36:22 +00:00
Marius Vollmer
aeec5be115 (scm_eval_string_in_module): Validate second arg to be a module.
Thanks to Arno Peters!
2002-11-17 10:35:49 +00:00
Dirk Herrmann
80b28865d1 * .cvsignore: remove goops.c 2002-11-16 18:30:18 +00:00
Dirk Herrmann
c88b1456e0 * modules.c (scm_env_top_level, scm_lookup_closure_module,
module_variable, scm_module_lookup_closure,
scm_module_transformer, scm_sym2var, scm_module_reverse_lookup,
scm_system_module_env_p):  Don't compare SCM values with C
operators == or !=.  Avoid SCM_IMP predicates.  Prefer !SCM_FALSEP
over SCM_NFALSEP.
2002-11-16 16:56:52 +00:00
Dirk Herrmann
a8a19efc2b * eval.h (SCM_MAKE_ILOC): New macro.
* debug.c (scm_make_iloc):  Use SCM_MAKE_ILOC instead of computing
the iloc bitpattern here.
2002-11-16 16:20:14 +00:00
Mikael Djurfeldt
7673491416 * coop-pthreads.c, coop-pthreads.h: scm_internal_select should be
part of the API, otherwise it's difficult to write Guile
extensions using non-blocking I/O => moved #include
"libguile/iselect.h" from coop-pthreads.c --> coop-pthreads.h.

* coop-pthreads.c (scm_unlock_mutex): Changed s_lock_mutex -->
s_unlock_mutex.
2002-11-14 17:17:40 +00:00
Marius Vollmer
8b5b4a758c *** empty log message *** 2002-11-10 22:07:10 +00:00
Marius Vollmer
ccb8b13859 (USE_THREADS, GUILE_ISELECT): Do not define here. They are defined in
configure.in.
2002-11-10 22:05:22 +00:00
Marius Vollmer
911782b79c Removed SCM_API from function definitions. SCM_API is only for
declarations.
2002-11-10 22:04:26 +00:00
Mikael Djurfeldt
9be8bb4541 * coop-pthreads.h: Added support for thread specific data to the
generic C API for the coop-pthreads case.
2002-11-07 14:35:08 +00:00
Mikael Djurfeldt
6c214b6217 * threads.c, threads.h (scm_cond_broadcast): Added missing function. 2002-11-07 13:55:25 +00:00
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