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

6843 commits

Author SHA1 Message Date
Neil Jerram
14a9ba3f2c Remove commented-out declarations (related to Elisp). 2002-12-29 01:17:39 +00:00
Neil Jerram
db85376112 Add a hook that is run whenever a new module is defined. 2002-12-28 20:14:21 +00:00
Neil Jerram
6054d8052e Remove superfluous code (previously commented out). 2002-12-28 20:10:49 +00:00
Neil Jerram
c6a040a82a Code (work in progress, currently disabled) for reading Elisp-syntax vectors. 2002-12-28 19:57:14 +00:00
Neil Jerram
740a6d1a26 New stub definitions for char-table primitives. 2002-12-28 19:22:11 +00:00
Marius Vollmer
3742c12f5d *** empty log message *** 2002-12-26 15:00:50 +00:00
Marius Vollmer
93eaa2a224 (c-tokenize.o): Refer to source via $< so that vpath
builds work.
(EXTRA_DIST): Added version.h.in.
2002-12-26 15:00:23 +00:00
Mikael Djurfeldt
fb50ef08ec * gc.c, gc.h (scm_i_sweep_mutex): New mutex.
* gc.c (scm_gc_for_newcell), gc-malloc.c (scm_realloc,
scm_gc_register_collectable_memory): Substitute locking of
scm_i_sweep_mutex for calls to scm_i_thread_put_to_sleep.
(scm_igc): Lock sweep mutex here instead of in callers; Calls to
scm_i_thread_put_to_sleep/scm_i_thread_wake_up used to demarkate
the single-thread section (which now only contains the mark
phase).
(scm_gc): Don't lock sweeo mutex here since scm_igc locks it;
Removed SCM_DEFER/ALLOW_INTS.  Simply call scm_igc directly.

* threads.c (gc_section_mutex): Removed.
2002-12-21 18:59:47 +00:00
Mikael Djurfeldt
0d48aca527 * threads.c (create_thread): Clear parent field in root state in
order not to unnecessarily remember dead threads.
2002-12-19 08:08:39 +00:00
Mikael Djurfeldt
b7b6a116e6 Added back two macros used when debugging. (Got lost by mistake during
a recent change.)
2002-12-19 08:00:23 +00:00
Mikael Djurfeldt
9ed246339f * eval.c (call_subr2o_1, call_lsubr2_2): New functions.
(scm_trampoline_1, scm_trampoline_2): Use them.
2002-12-19 07:49:15 +00:00
Mikael Djurfeldt
b21dcf17d7 Fix 2002-12-18 14:15:11 +00:00
Mikael Djurfeldt
29717c8931 * Makefile.am (modinclude_HEADERS): Added threads-plugin.h.
(EXTRA_DIST): Added threads-plugin.c.

* threads-plugin.h, threads-plugin.c: New files.

* threads.h: #include "libguile/threads-plugin.h".

* threads.c: #include "libguile/threads-plugin.c".

* pthread-threads.c: Temporarily remove debugging functions.

* threads.c, threads.h (scm_yield): Added back.
2002-12-18 13:42:58 +00:00
Mikael Djurfeldt
62d4fd94a6 * threads.scm: Removed bogus definition of future-ref. 2002-12-18 11:00:56 +00:00
Mikael Djurfeldt
e29e0b0963 * threads.c (really_launch): Detach before unlocking
thread_admin_mutex in order not to risk being joined.
(scm_i_thread_put_to_sleep, scm_i_thread_wake_up): Keep
thread_admin_mutex locked during GC.

* pthread-threads.c, pthread-threads.h: Improvements to debugging
functions.
2002-12-18 10:53:23 +00:00
Mikael Djurfeldt
dad981029a Fix... 2002-12-16 21:02:37 +00:00
Mikael Djurfeldt
6da2dfc4e0 * pthread-threads.c, pthread-threads.h (SCM_DEBUG_THREADS): Added
support for debugging mutex operations.
2002-12-16 20:29:18 +00:00
Mikael Djurfeldt
0b6843b1eb * threads.c (scm_thread): Removed filed joining_threads.
(thread_print): Print thread number as well as address of thread
structure.
(scm_join_thread): Bugfix.
(scm_lock_mutex, scm_try_mutex, scm_unlock_mutex,
scm_timed_wait_condition_variable, scm_signal_condition_variable,
scm_broadcast_condition_variable): Use the low-level API.
(scm_all_threads): Return copy of thread list (to prevent
unintended destruction).
(scm_threads_prehistory): Initialize heap_mutex of fake thread.
2002-12-16 15:24:13 +00:00
Mikael Djurfeldt
1b92fb6b4d * threads.c (scm_thread): Removed filed joining_threads.
(thread_print): Print thread number as well as address of thread
structure.
2002-12-16 10:33:49 +00:00
Mikael Djurfeldt
dea5539eec * pthread-threads.c, pthread-threads.h, threads.c: Fixes to
pthread "native" recursive mutex support.
2002-12-16 09:50:21 +00:00
Mikael Djurfeldt
93cd4dcd9c * pthread-threads.c, pthread-threads.h, threads.c: Fixes to
pthread "native" recursive mutex support.
2002-12-16 09:28:38 +00:00
Mikael Djurfeldt
09841c7783 * configure.in: Test if pthread.h declares
pthread_mutexattr_settype ().
2002-12-16 09:25:48 +00:00
Mikael Djurfeldt
876235959d * threads.scm (par-map, par-for-each): Reimplemented using
joing-thread.
(parallel): Reimplemented using futures.
(n-par-map, n-for-each): New procedures.
2002-12-15 14:36:19 +00:00
Mikael Djurfeldt
28d52ebb19 * __scm.h (SCM_DEFER_INTS, SCM_ALLOW_INTS): New definitions.
Simply lock a thread C API recursive mutex.
(SCM_NONREC_CRITICAL_SECTION_START,
SCM_NONREC_CRITICAL_SECTION_END, SCM_REC_CRITICAL_SECTION_START,
SCM_REC_CRITICAL_SECTION_END): Removed.

* eval.c: Replaced SOURCE_SECTION_START / SOURCE_SECTION_END with
direct calls to scm_rec_mutex_lock / unlock around the three calls
to scm_m_expand_body.

* eval.c, eval.h (promise_free): New function.
(scm_force): Rewritten;  Now thread-safe; Removed
SCM_DEFER/ALLOW_INTS.

* pthread-threads.h: Added partially implemented plugin interface
for recursive mutexes.  These are, for now, only intended to be
used internally within the Guile implementation.

* pthread-threads.c: New file.

* threads.c: Conditionally #include "pthread-threads.c".

* eval.c, eval.h (scm_makprom, scm_force): Rewritten to be
thread-safe;

* snarf.h (SCM_MUTEX, SCM_GLOBAL_MUTEX, SCM_REC_MUTEX,
SCM_GLOBAL_REC_MUTEX): New macros.

* eval.c, threads.c, threads.h, snarf.h: Rewrote critical section
macros---use mutexes instead.

* tags.h (SCM_IM_FUTURE): New tag.

* eval.c (scm_m_future): New primitive macro.
(SCM_CEVAL): Support futures.
(unmemocopy): Support unmemoization of futures.

* print.c (scm_isymnames): Name of future isym.
2002-12-15 14:24:34 +00:00
Mikael Djurfeldt
2ff4f18159 * version.c: Unmade some changes to my private copy that got
committed by mistake.
2002-12-15 11:27:01 +00:00
Marius Vollmer
edeea67b5a *** empty log message *** 2002-12-12 20:45:38 +00:00
Marius Vollmer
2a05206662 (improper-list-copy): New.
(parse-arglist): Use it instead of list-copy.
2002-12-12 20:43:11 +00:00
Mikael Djurfeldt
e200ddeeb2 * gc-malloc.c, gc.h, init.c: Reverted gc-malloc change of
2002-12-10.
2002-12-11 08:35:22 +00:00
Mikael Djurfeldt
392d2833a2 * gc.c (scm_igc): Don't call scm_i_thread_invalidate_freelists.
* gc.c (scm_gc_sweep): Call it here instead, which is a more
logical place.

* threads.c (create_thread): Remember root object until the handle
of the new thread is on all_threads list.

* root.c (scm_make_root): Moved copying of fluids until after
creation of root handle so that the fluids are GC protected.  Also
removed the critical section.
2002-12-11 06:54:59 +00:00
Mikael Djurfeldt
960c408c04 * gc-malloc.c, gc.h (scm_gc_malloc_prehistory): New function.
* gc-malloc.c (malloc_mutex): New mutex.
(scm_gc_malloc_prehistory): Initialize it.
(scm_realloc): Serialize call to realloc
(scm_calloc): Same for calloc.
Thanks to Wolfgang Jaehrling!
(Now we have to make sure all calls to malloc/realloc are made
through scm_malloc.)

* init.c (scm_init_guile_1): Call scm_gc_malloc_prehistory.
2002-12-10 20:25:26 +00:00
Mikael Djurfeldt
3cdde9d667 * gc-malloc.c (malloc_mutex): New mutex.
(scm_gc_init_malloc): Initialize it.
(scm_realloc): Serialize call to realloc
(scm_calloc): Same for calloc.
Thanks to Wolfgang Jaehrling!
(Now we have to make sure all calls to malloc/realloc are made
through scm_malloc.)
2002-12-10 20:09:45 +00:00
Mikael Djurfeldt
5b5947a2b5 Removed incorrect comment. 2002-12-10 18:23:38 +00:00
Mikael Djurfeldt
ad280ae0a3 * configure.in (_THREAD_SAFE): Define when pthreads are enabled in
order to get thread safe versions of glibc functions.
2002-12-10 17:54:01 +00:00
Mikael Djurfeldt
094b640d77 (create_thread): Release heap before locking thread admin mutex. 2002-12-10 17:27:31 +00:00
Mikael Djurfeldt
c4c52ebe30 * threads.c (really_launch): Release heap (to prevent deadlock).
(create_thread): Release heap before locking thread admin mutex.
2002-12-10 16:51:14 +00:00
Mikael Djurfeldt
b0dc3d710a * threads.c (scm_i_thread_invalidate_freelists): New
function.

* gc.c (scm_igc): Call scm_i_thread_invalidate_freelists.
2002-12-10 16:09:37 +00:00
Mikael Djurfeldt
8c3300070b * modules.c (scm_export): Inserted a return statement. 2002-12-10 16:07:30 +00:00
Han-Wen Nienhuys
06e80f59f9 * modules.c (scm_export): new function
* gc-card.c: add a note about malloc()/free() overhead.
2002-12-10 13:26:25 +00:00
Mikael Djurfeldt
a12611c3e7 * Makefile.am (c-tokenize.$(OBJEXT)): Don't look for c-tokenize.c
in srcdir.
2002-12-10 10:31:44 +00:00
Mikael Djurfeldt
c7fabadfe0 * async.c, error.h (scm_ints_disabled): Removed.
* gc.c (scm_gc_for_newcell), init.c (scm_init_guile_1),
root.c (scm_internal_cwdr), gdbint.c (SCM_BEGIN_FOREIGN_BLOCK,
SCM_END_FOREIGN_BLOCK): Don't touch scm_ints_disabled.
(old_ints): Removed.

* __scm.h (SCM_DEFER_INTS, SCM_ALLOW_INTS): Define as a recursive
critical section.
(SCM_REDEFER_INTS, SCM_ALLOW_INTS): Define as SCM_DEFER_INTS and
SCM_ALLOW_INTS.
2002-12-10 09:35:06 +00:00
Mikael Djurfeldt
06babeccd1 *** empty log message *** 2002-12-10 08:54:48 +00:00
Mikael Djurfeldt
52340b651a * threads.c (scm_mutex_lock, scm_cond_wait, scm_cond_timedwait):
Removed accidental #if 0 around these functions.
2002-12-09 19:27:44 +00:00
Mikael Djurfeldt
9bc4701cd3 * __scm.h (SCM_ALLOW_INTS_ONLY): Removed.
(SCM_NONREC_CRITICAL_SECTION_START,
SCM_NONREC_CRITICAL_SECTION_END, SCM_REC_CRITICAL_SECTION_START,
SCM_REC_CRITICAL_SECTION_END): New macros.
(SCM_CRITICAL_SECTION_START/END): Defined here.

* eval.c: Insert SOURCE_SECTION_START / SOURCE_SECTION_END around
the three calls to scm_m_expand_body.

* gc.h: #include "libguile/pthread-threads.h";
(SCM_FREELIST_CREATE, SCM_FREELIST_LOC): New macros.

* gc.c (scm_i_freelist, scm_i_freelist2): Defined to be of type
scm_t_key;

* gc.c, gc-freelist.c, inline.h: Use SCM_FREELIST_LOC for freelist
access.

* gc-freelist.c (scm_gc_init_freelist): Create freelist keys.

* gc-freelist.c, threads.c (really_launch): Use
SCM_FREELIST_CREATE.

* gc-malloc.c (scm_realloc, scm_gc_register_collectable_memory):

* gc.c (scm_i_expensive_validation_check, scm_gc,
scm_gc_for_newcell): Put threads to sleep before doing GC-related
heap administration so that those pieces of code are executed
single-threaded.  We might consider rewriting these code sections
in terms of a "call_gc_code_singly_threaded" construct instead of
calling the pair of scm_i_thread_put_to_sleep () and
scm_i_thread_wake_up ().  Also, we would want to have as many of
these sections eleminated.

* init.c (scm_init_guile_1): Call scm_threads_prehistory.

* inline.h: #include "libguile/threads.h"

* pthread-threads.h: Macros now conform more closely to the
pthreads interface.  Some of them now take a second argument.

* threads.c, threads.h: Many changes.

* configure.in: Temporarily replaced "copt" threads option with new
option "pthreads".
(USE_PTHREAD_THREADS): Define if pthreads configured.
2002-12-09 13:42:58 +00:00
Mikael Djurfeldt
fc85d09560 * threads.scm (letpar): New macro. 2002-12-09 12:58:52 +00:00
Rob Browning
9e6e154e84 * configure.in (GUILE_EFFECTIVE_VERSION): AC_SUBST it.
(AC_CONFIG_FILES): separate out the files that need to be chmodded
at the end of config.status.  Our "default" approach using
AC_CONFIG_COMMANDS quit working (and would have needed to be
changed to AC_CONFIG_COMMANDS(,,CMDS) rather than our previous
AC_CONFIG_COMMANDS(default,CMDS), but I the new approach, using
per-file AC_CONFIG_FILES calls appears to be more "correct" in the
current autoconf docs.
2002-12-09 00:52:03 +00:00
Rob Browning
b2cbe8d8a2 *** empty log message *** 2002-12-09 00:51:53 +00:00
Rob Browning
08f406b068 * GUILE-VERSION (GUILE_EFFECTIVE_VERSION): new variable. 2002-12-09 00:51:10 +00:00
Rob Browning
3d9782e928 * debugger/breakpoints/Makefile.am (subpkgdatadir): VERSION ->
GUILE_EFFECTIVE_VERSION.

* debugger/Makefile.am (subpkgdatadir): VERSION ->
GUILE_EFFECTIVE_VERSION.

* Makefile.am (subpkgdatadir): VERSION -> GUILE_EFFECTIVE_VERSION.
2002-12-09 00:50:34 +00:00
Rob Browning
717a0e5b8c * Makefile.am (ice9dir): VERSION -> GUILE_EFFECTIVE_VERSION. 2002-12-09 00:50:17 +00:00
Rob Browning
41d8c90a5e * configure.in (GUILE_EFFECTIVE_VERSION): AC_SUBST. 2002-12-09 00:50:10 +00:00