*** empty log message ***
[bpt/guile.git] / libguile / ChangeLog
CommitLineData
ebf9b47c
MD
12002-12-29 Mikael Djurfeldt <djurfeldt@nada.kth.se>
2
3 * eval.c (unmemocopy): Bugfix: scm_sym_delay --> scm_sym_future.
2e37d6a2 4 Thanks to Neil for pointing this out!
ebf9b47c 5
14a9ba3f
NJ
62002-12-29 Neil Jerram <neil@ossau.uklinux.net>
7
8 * lang.h: Remove declarations matching definitions removed from
9 lang.c (just below).
10
c6a040a8
NJ
112002-12-28 Neil Jerram <neil@ossau.uklinux.net>
12
6054d805
NJ
13 * lang.c (scm_nil_cons, scm_nil_car, scm_nil_cdr, scm_null,
14 scm_m_while, scm_nil_eq): Remove definitions that were superfluous
15 and already commented out.
16
c6a040a8
NJ
17 * read.h (scm_lreadparen), read.c (scm_lreadr, scm_read_token,
18 scm_lreadparen): Support reading vectors with Elisp syntax if
19 SCM_ELISP_READ_EXTENSIONS is defined. (SCM_ELISP_READ_EXTENSIONS
20 is not currently defined, and there isn't even a configure switch
21 to enable it yet.)
22
3742c12f
MV
232002-12-26 Marius Vollmer <mvo@zagadka.ping.de>
24
25 * Makefile.am (c-tokenize.o): Refer to source via $< so that vpath
26 builds work.
27 (EXTRA_DIST): Added version.h.in.
28
fb50ef08
MD
292002-12-21 Mikael Djurfeldt <djurfeldt@nada.kth.se>
30
31 This change makes it possible for one thread to do lazy sweeping
32 while other threads are running. Now only the mark phase need to
33 have all threads asleep. We should look further into this issue.
34 Presently, I've put the locking of scm_i_sweep_mutex at
35 "conservative" places due to my current lack of knowledge about
36 the garbage collector. Please feel free to restrict these regions
37 further to allow for maximal parallelism!
38
39 * gc.c, gc.h (scm_i_sweep_mutex): New mutex.
40
41 * gc.c (scm_gc_for_newcell), gc-malloc.c (scm_realloc,
42 scm_gc_register_collectable_memory): Substitute locking of
43 scm_i_sweep_mutex for calls to scm_i_thread_put_to_sleep.
44 (scm_igc): Lock sweep mutex here instead of in callers; Calls to
45 scm_i_thread_put_to_sleep/scm_i_thread_wake_up used to demarkate
46 the single-thread section (which now only contains the mark
47 phase).
48 (scm_gc): Don't lock sweeo mutex here since scm_igc locks it;
49 Removed SCM_DEFER/ALLOW_INTS. Simply call scm_igc directly.
50
51 * threads.c (gc_section_mutex): Removed.
52
9ed24633
MD
532002-12-19 Mikael Djurfeldt <mdj@kvast.blakulla.net>
54
0d48aca5
MD
55 * threads.c (create_thread): Clear parent field in root state in
56 order not to unnecessarily remember dead threads.
57
9ed24633
MD
58 * eval.c (call_subr2o_1, call_lsubr2_2): New functions.
59 (scm_trampoline_1, scm_trampoline_2): Use them.
60
29717c89
MD
612002-12-18 Mikael Djurfeldt <mdj@kvast.blakulla.net>
62
63 Partial introduction of real plugin interface.
64
65 * Makefile.am (modinclude_HEADERS): Added threads-plugin.h.
66 (EXTRA_DIST): Added threads-plugin.c.
67
68 * threads-plugin.h, threads-plugin.c: New files.
69
70 * threads.h: #include "libguile/threads-plugin.h".
71
72 * threads.c: #include "libguile/threads-plugin.c".
73
74 * pthread-threads.c: Temporarily remove debugging functions.
75
76 * threads.c, threads.h (scm_yield): Added back.
77
e29e0b09
MD
782002-12-18 Mikael Djurfeldt <mdj@kvast.blakulla.net>
79
80 * threads.c (really_launch): Detach before unlocking
81 thread_admin_mutex in order not to risk being joined.
82 (scm_i_thread_put_to_sleep, scm_i_thread_wake_up): Keep
83 thread_admin_mutex locked during GC.
84
85 * pthread-threads.c, pthread-threads.h: Improvements to debugging
86 functions.
87
0b6843b1 882002-12-16 Mikael Djurfeldt <mdj@kvast.blakulla.net>
93cd4dcd 89
6da2dfc4
MD
90 * pthread-threads.c, pthread-threads.h (SCM_DEBUG_THREADS): Added
91 support for debugging mutex operations.
92
1b92fb6b
MD
93 * threads.c (scm_thread): Removed filed joining_threads.
94 (thread_print): Print thread number as well as address of thread
95 structure.
0b6843b1
MD
96 (scm_join_thread): Bugfix.
97 (scm_lock_mutex, scm_try_mutex, scm_unlock_mutex,
98 scm_timed_wait_condition_variable, scm_signal_condition_variable,
99 scm_broadcast_condition_variable): Use the low-level API.
100 (scm_all_threads): Return copy of thread list (to prevent
101 unintended destruction).
102 (scm_threads_prehistory): Initialize heap_mutex of fake thread.
1b92fb6b 103
93cd4dcd
MD
104 * pthread-threads.c, pthread-threads.h, threads.c: Fixes to
105 pthread "native" recursive mutex support.
106
2ff4f181
MD
1072002-12-15 Mikael Djurfeldt <djurfeldt@nada.kth.se>
108
28d52ebb
MD
109 * __scm.h (SCM_DEFER_INTS, SCM_ALLOW_INTS): New definitions.
110 Simply lock a thread C API recursive mutex.
111 (SCM_NONREC_CRITICAL_SECTION_START,
112 SCM_NONREC_CRITICAL_SECTION_END, SCM_REC_CRITICAL_SECTION_START,
113 SCM_REC_CRITICAL_SECTION_END): Removed.
114
115 * eval.c: Replaced SOURCE_SECTION_START / SOURCE_SECTION_END with
116 direct calls to scm_rec_mutex_lock / unlock around the three calls
117 to scm_m_expand_body.
118
119 * eval.c, eval.h (promise_free): New function.
120 (scm_force): Rewritten; Now thread-safe; Removed
121 SCM_DEFER/ALLOW_INTS.
122
123 * pthread-threads.h: Added partially implemented plugin interface
124 for recursive mutexes. These are, for now, only intended to be
125 used internally within the Guile implementation.
126
127 * pthread-threads.c: New file.
128
129 * threads.c: Conditionally #include "pthread-threads.c".
130
131 * eval.c, eval.h (scm_makprom, scm_force): Rewritten to be
132 thread-safe;
133
134 * snarf.h (SCM_MUTEX, SCM_GLOBAL_MUTEX, SCM_REC_MUTEX,
135 SCM_GLOBAL_REC_MUTEX): New macros.
136
137 * eval.c, threads.c, threads.h, snarf.h: Rewrote critical section
138 macros---use mutexes instead.
139
140 * tags.h (SCM_IM_FUTURE): New tag.
141
142 * eval.c (scm_m_future): New primitive macro.
143 (SCM_CEVAL): Support futures.
144 (unmemocopy): Support unmemoization of futures.
145
146 * print.c (scm_isymnames): Name of future isym.
147
2ff4f181
MD
148 * version.c: Unmade some changes to my private copy that got
149 committed by mistake.
150
392d2833
MD
1512002-12-11 Mikael Djurfeldt <mdj@kvast.blakulla.net>
152
e200ddee
MD
153 * gc-malloc.c, gc.h, init.c: Reverted gc-malloc change of
154 2002-12-10.
155
392d2833
MD
156 * gc.c (scm_igc): Don't call scm_i_thread_invalidate_freelists.
157
158 * gc.c (scm_gc_sweep): Call it here instead, which is a more
159 logical place.
160
161 * threads.c (create_thread): Remember root object until the handle
162 of the new thread is on all_threads list.
163
164 * root.c (scm_make_root): Moved copying of fluids until after
165 creation of root handle so that the fluids are GC protected. Also
166 removed the critical section.
167
c4c52ebe
MD
1682002-12-10 Mikael Djurfeldt <mdj@kvast.blakulla.net>
169
960c408c
MD
170 * gc-malloc.c, gc.h (scm_gc_malloc_prehistory): New function.
171
3cdde9d6 172 * gc-malloc.c (malloc_mutex): New mutex.
960c408c 173 (scm_gc_malloc_prehistory): Initialize it.
3cdde9d6
MD
174 (scm_realloc): Serialize call to realloc
175 (scm_calloc): Same for calloc.
176 Thanks to Wolfgang Jaehrling!
177 (Now we have to make sure all calls to malloc/realloc are made
178 through scm_malloc.)
179
960c408c
MD
180 * init.c (scm_init_guile_1): Call scm_gc_malloc_prehistory.
181
c4c52ebe
MD
182 * threads.c (really_launch): Release heap (to prevent deadlock).
183 (create_thread): Release heap before locking thread admin mutex.
184
b0dc3d71
MD
1852002-12-10 Mikael Djurfeldt <mdj@kvast.blakulla.net>
186
187 * threads.c (scm_i_thread_invalidate_freelists): New
188 function.
189
190 * gc.c (scm_igc): Call scm_i_thread_invalidate_freelists.
191
192 * modules.c (scm_export): Inserted a return statement.
193
06e80f59
HWN
1942002-12-10 Han-Wen Nienhuys <hanwen@cs.uu.nl>
195
196 * modules.c (scm_export): new function
197
198 * gc-card.c: add a note about malloc()/free() overhead.
199
a12611c3
MD
2002002-12-10 Mikael Djurfeldt <mdj@kvast.blakulla.net>
201
202 * Makefile.am (c-tokenize.$(OBJEXT)): Don't look for c-tokenize.c
203 in srcdir.
204
c7fabadf
MD
2052002-12-10 Mikael Djurfeldt <djurfeldt@nada.kth.se>
206
207 These changes remove scm_ints_disabled (which hasn't has any
208 effect in Guile for quite some time).
209
210 * async.c, error.h (scm_ints_disabled): Removed.
211
212 * gc.c (scm_gc_for_newcell), init.c (scm_init_guile_1),
213 root.c (scm_internal_cwdr), gdbint.c (SCM_BEGIN_FOREIGN_BLOCK,
214 SCM_END_FOREIGN_BLOCK): Don't touch scm_ints_disabled.
215 (old_ints): Removed.
216
217 * __scm.h (SCM_DEFER_INTS, SCM_ALLOW_INTS): Define as a recursive
218 critical section.
219 (SCM_REDEFER_INTS, SCM_ALLOW_INTS): Define as SCM_DEFER_INTS and
220 SCM_ALLOW_INTS.
221
9bc4701c
MD
2222002-12-09 Mikael Djurfeldt <djurfeldt@nada.kth.se>
223
52340b65
MD
224 * threads.c (scm_mutex_lock, scm_cond_wait, scm_cond_timedwait):
225 Removed accidental #if 0 around these functions.
226
9bc4701c
MD
227 These changes are the start of support for preemptive
228 multithreading. Marius and I have agreed that I commit this code
229 into the repository although it isn't thoroughly tested and surely
230 introduces many bugs. The bugs should only be exposed when using
231 threads, though. Signalling and error handling for threads is
232 very likely broken. Work on making the implementation cleaner and
233 more efficient is needed.
234
235 * __scm.h (SCM_ALLOW_INTS_ONLY): Removed.
236 (SCM_NONREC_CRITICAL_SECTION_START,
237 SCM_NONREC_CRITICAL_SECTION_END, SCM_REC_CRITICAL_SECTION_START,
238 SCM_REC_CRITICAL_SECTION_END): New macros.
239 (SCM_CRITICAL_SECTION_START/END): Defined here.
240
241 * eval.c: Insert SOURCE_SECTION_START / SOURCE_SECTION_END around
242 the three calls to scm_m_expand_body.
243
244 * gc.h: #include "libguile/pthread-threads.h";
245 (SCM_FREELIST_CREATE, SCM_FREELIST_LOC): New macros.
246
247 * gc.c (scm_i_freelist, scm_i_freelist2): Defined to be of type
248 scm_t_key;
249
250 * gc.c, gc-freelist.c, inline.h: Use SCM_FREELIST_LOC for freelist
251 access.
252
253 * gc-freelist.c (scm_gc_init_freelist): Create freelist keys.
254
255 * gc-freelist.c, threads.c (really_launch): Use
256 SCM_FREELIST_CREATE.
257
258 * gc-malloc.c (scm_realloc, scm_gc_register_collectable_memory):
259
260 * gc.c (scm_i_expensive_validation_check, scm_gc,
261 scm_gc_for_newcell): Put threads to sleep before doing GC-related
262 heap administration so that those pieces of code are executed
263 single-threaded. We might consider rewriting these code sections
264 in terms of a "call_gc_code_singly_threaded" construct instead of
265 calling the pair of scm_i_thread_put_to_sleep () and
266 scm_i_thread_wake_up (). Also, we would want to have as many of
267 these sections eleminated.
268
269 * init.c (scm_init_guile_1): Call scm_threads_prehistory.
270
271 * inline.h: #include "libguile/threads.h"
272
273 * pthread-threads.h: Macros now conform more closely to the
274 pthreads interface. Some of them now take a second argument.
275
276 * threads.c, threads.h: Many changes.
277
2782002-12-09 Mikael Djurfeldt <djurfeldt@nada.kth.se>
279
280 * Makefile.am (version.h): Changed $^ --> $< in rule for
281 version.h.
282
b2cbe8d8
RB
2832002-12-08 Rob Browning <rlb@defaultvalue.org>
284
285 * version.h.in (SCM_MICRO_VERSION): use @--@ substitution now.
286 (SCM_MINOR_VERSION): use @--@ substitution now.
287 (SCM_MICRO_VERSION): use @--@ substitution now.
288 (scm_effective_version): new function prototype.
289
290 * version.c (scm_effective_version): new function, also add
291 effective-version.
292
293 * Makefile.am (schemelibdir): VERSION -> GUILE_EFFECTIVE_VERSION.
294 (libpath.h): use GUILE_EFFECTIVE_VERSION to compute
295 SCM_LIBRARY_DIR.
296 (version.h): generate this here rather than configure.in. This
297 approach tracks source edits better (i.e. more immediately).
298 Might be worth considering for other .in files too.
299
5441c65c
MV
3002002-12-02 Marius Vollmer <mvo@zagadka.ping.de>
301
302 Reorganized thread package selection. A thread package now only
303 implements a small set of pthread like functions and Guile
304 implements the rest on top of that. Guile's implementation is
305 what the "coop-pthreads" package has been previously. Support for
306 "coop" threads has been removed until I get time to add it again.
307
308 * Makefile.am (libguile_la_SOURCES): Removed iselect.c.
309 (noinst_HEADERS): Removed coop-threads.c, coop-threads.h, coop.c,
310 null-threads.c, coop-pthreads.c.
311 (modinclude_HEADERS): Removed coop-defs.h, coop-pthreads.h. Added
312 pthread-threads.h.
313
314 * validate.h (SCM_VALIDATE_THREAD): Moved to threads.h.
315
316 * threads.h: Do not include "libguile/coop-defs.h". Include
317 "libguile/pthread-threads.h" for USE_COPT_THREADS. Removed
318 (previously deprecated) C level thread API prototypes. They are
319 now in the thread package specific headers, "null-threads.h" and
320 "pthread-threads.h".
321 (SCM_VALIDATE_THREAD, SCM_VALIDATE_MUTEX, SCM_VALIDATE_CONDVAR):
322 New.
323 (scm_threads_init): Removed.
324 (SCM_CRITICAL_SECTION_START, SCM_CRITICAL_SECTION_END,
325 SCM_THREAD_SWITCHING_CODE, scm_i_switch_counter,
326 SCM_I_THREAD_SWITCH_COUNT): Define here.
327 (scm_single_thread_p): Removed.
328 (scm_call_with_new_thread): Take two args directly instead of list
329 of two args.
330 (scm_i_thread_data, scm_i_set_thread_data, SCM_THREAD_LOCAL_DATA,
331 SCM_SET_THREAD_LOCAL_DATA): Define here.
332
333 * threads.c: Merged with "coop-pthreads.c".
334
335 * null-threads.h: Implement pthread-like API as a set of macros.
336
337 * pthread-threads.h: New, implement pthread-like API by deferring
338 to pthread itself.
339
340 * init.c (scm_init_guile_1): Do not call scm_init_iselect, which
341 has been lost in the reorganization.
342
504d99c5
MD
3432002-12-01 Mikael Djurfeldt <mdj@linnaeus>
344
345 The following change makes it possible to move procedure
346 application dispatch outside inner loops. The motivation was
347 clean implementation of efficient replacements of R5RS primitives
348 in SRFI-1.
349
350 The semantics is clear: scm_trampoline_N returns an optimized
351 version of scm_call_N (or NULL if the procedure isn't applicable
352 on N args).
353
354 Applying the optimization to map and for-each increases efficiency
355 noticeably. For example, (map abs ls) is 8 times faster than
356 before.
357
358 * eval.h (scm_t_trampoline_1, scm_t_trampoline_2): New types.
359
360 * eval.c, eval.h (scm_trampoline_1, scm_trampoline_2): New functions.
361
362 * eval.c (call_subr2_2, call_lsubr_2, call_closure_2): New functions;
363 (map, for-each): Handle also application on two args as a special
364 case; Use trampolines.
365
366 Other changes:
367
368 * sort.c (scm_cmp_function): Choose subr2less for scm_tc7_subr_2o;
369 (subr2oless): Removed.
370 (scm_restricted_vector_sort_x): Use scm_return_first to keep the
371 vector GC protected.
372
373 * eval.c (check_map_args): Use scm_out_of_range_pos instead of
374 scm_out_of_range.
375
63dd3413
DH
3762002-11-24 Dirk Herrmann <D.Herrmann@tu-bs.de>
377
378 * evalext.[ch] (scm_m_undefine, undefine): Deprecated.
379
4ba5f279
MD
3802002-11-17 Mikael Djurfeldt <mdj@linnaeus>
381
382 * debug.c (scm_make_iloc): Added missing "return".
383
56ae231f
MV
3842002-11-17 Marius Vollmer <mvo@zagadka.ping.de>
385
386 * strports.c (scm_eval_string_in_module): Validate second arg to
387 be a module. Thanks to Arno Peters!
388
80b28865
DH
3892002-11-16 Dirk Herrmann <D.Herrmann@tu-bs.de>
390
391 * .cvsignore: remove goops.c
392
c88b1456
DH
3932002-11-16 Dirk Herrmann <D.Herrmann@tu-bs.de>
394
395 * modules.c (scm_env_top_level, scm_lookup_closure_module,
396 module_variable, scm_module_lookup_closure,
397 scm_module_transformer, scm_sym2var, scm_module_reverse_lookup,
398 scm_system_module_env_p): Don't compare SCM values with C
399 operators == or !=. Avoid SCM_IMP predicates. Prefer !SCM_FALSEP
400 over SCM_NFALSEP.
401
a8a19efc
DH
4022002-11-16 Dirk Herrmann <D.Herrmann@tu-bs.de>
403
404 * eval.h (SCM_MAKE_ILOC): New macro.
405
406 * debug.c (scm_make_iloc): Use SCM_MAKE_ILOC instead of computing
407 the iloc bitpattern here.
408
76734914
MD
4092002-11-14 Mikael Djurfeldt <mdj@linnaeus>
410
411 * coop-pthreads.c, coop-pthreads.h: scm_internal_select should be
412 part of the API, otherwise it's difficult to write Guile
413 extensions using non-blocking I/O => moved #include
414 "libguile/iselect.h" from coop-pthreads.c --> coop-pthreads.h.
415
416 * coop-pthreads.c (scm_unlock_mutex): Changed s_lock_mutex -->
417 s_unlock_mutex.
418
8b5b4a75
MV
4192002-11-10 Marius Vollmer <mvo@zagadka.ping.de>
420
421 * __scm.h (USE_THREADS, GUILE_ISELECT): Do not define here. They
422 are defined in configure.in.
423
424 * threads.c: Removed SCM_API from function definitions. SCM_API
425 is only for declarations.
426
e5a83084
MD
4272002-11-07 Mikael Djurfeldt <mdj@linnaeus>
428
9be8bb45
MD
429 * coop-pthreads.h: Added support for thread specific data to the
430 generic C API for the coop-pthreads case.
431
e5a83084
MD
432 * threads.c, threads.h (scm_cond_init): Undo unintentional API
433 change.
6c214b62 434 (scm_cond_broadcast): Added missing function.
e5a83084 435
7edf178e
MV
4362002-11-04 Marius Vollmer <marius.vollmer@uni-dortmund.de>
437
438 * coop.c (coop_next_runnable_thread): Removed, wich should have
439 happened when GUILE_ISELECT was hard-wired.
440
7f5b1b77
MV
4412002-11-03 Marius Vollmer <mvo@zagadka.ping.de>
442
7caa1b07
MV
443 * Makefile.am (libguile_la_SOURCES): Added threads.c
444 (DOT_DOC_FILES): Added threads.doc.
445 (DOT_X_FILES): Added threads.x.
446 (EXTRA_libguile_la_SOURCES): Removed threads.c.
447 (noinst_HEADERS): Added coop-pthreads.c.
448 (modinclude_HEADERS): Added coop-pthreads.h.
449
450 * __scm.h (USE_THREADS, GUILE_ISELECT): Define when
451 SCM_DEBUG_DEPRECATED. Removed their use thru-out Guile.
452
bb11cbf4
MV
453 * iselect.c: Include "_scm.h" before testing HAVE_UNISTD_H.
454 Thanks to Bill Schottstaedt!
455
1d4cbbed
MV
456 * numbers.c (scm_integer_expt): Make 0^z == 0 for z != 0.
457
7f5b1b77
MV
458 * _scm.h (HAVE_RESTARTABLE_SYSCALLS): Do define even when
459 SCM_COPT_THREADS is defined.
460 (SCM_SYSCALL): Use EINTR-expection version when SCM_COPT_THREADS
461 is defined.
462
463 * coop-pthreads.c: Some harmless renamings of internal stuff.
464 (create_thread): New, generalized version of
465 scm_call_with_new_thread.
466 (scm_call_with_new_thread): Use it.
467 (scm_spawn_thread): New, use create_thread.
468
d52f53b1
MV
4692002-11-02 Marius Vollmer <mvo@zagadka.ping.de>
470
471 * coop-pthreads.c, coop-pthreads.h: Redone completely, you might
472 start testing it now.
473
474 * _scm.h: Include <errno.h< so that SCM_SYSCALL is correctly
475 defined when HAVE_RESTARTABLE_SYSCALLS is not defined.
476 (HAVE_RESTARTABLE_SYSCALLS): Do not define when USE_COPT_THREADS
477 is defined.
478
30f920c3
MV
4792002-10-27 Marius Vollmer <mvo@zagadka.ping.de>
480
481 * scmsigs.c (signal_cell_handlers, install_handler_data,
482 scm_delq_spine_x, really_install_handler, install_handler): New
483 scheme for triggering signal handlers, to simplify take_signal.
484 (take_signal): Simplified, to avoid race conditions.
485 (scm_sigaction_for_thread): Use new Scheme. Validate that thread
486 hasn't exited yet.
487
488 * async.c (scm_async_click): Reset pending_asyncs, handle
489 signal_asyncs. Don't set cdr of a non-signal async to #f.
490 (scm_i_queue_async_cell): Do not check cdr of cell for #f, queue
491 always. Set pending_asyncs.
492 (scm_system_async_mark_for_thread): Check that thread has not
493 exited.
494 (scm_unmask_signals, decrease_block): Call scm_async_click after
495 block_asyncs becomes zero.
496
497 * __scm.h (SCM_ASYNC_CLICK): Check pending_asyncs instead of
498 active_asyncs.
499
500 * root.h (scm_root_state): Added pending_asyncs and signal_asyncs
501 fields.
502 * root.c (root_mark): Mark them.
503 (make_root): Initialize them.
504
505 * iselect.c, iselect.h: Replaced GUILE_ISELECT with
506 USE_COOP_THREADS.
507 (scm_internal_select): Define one version for USE_COOP_THREADS and
508 one for USE_NULL_THREADS.
509 (scm_init_iselect): Likewise.
510
511 * inline.h (scm_cell, scm_double_cell): Also allow
512 USE_COPT_THREADS to not protect the slot initializers.
513
514 * init.c (scm_init_guile_1): Call scm_init_thread_procs. This is
515 because threads need to be initialized before the stack, but
516 gsubrs such as scm_timed_condition_variable_wait can only be
517 created later.
518
519 * threads.h: Include "coop-pthreads.h" when requested.
520 (scm_threads_make_mutex, scm_threads_lock_mutex,
521 scm_threads_unlock_mutex, scm_threads_monitor): Removed, they were
522 not implemented anyway.
523 (scm_init_thread_procs, scm_try_mutex,
524 scm_timed_condition_variable_wait,
525 scm_broadcast_condition_variable, scm_c_thread_exited_p,
526 scm_thread_exited_p): New prototypes.
527 (struct timespec): Define if not already defined.
528 (scm_t_mutex, scm_mutex_init, scm_mutex_lock, scm_mutex_trylock,
529 scm_mutex_unlock, scm_mutex_destroy, scm_t_cond, scm_cond_init,
530 scm_cond_wait, scm_cond_timedwait, scm_cond_signal,
531 scm_cond_broadcast, scm_cond_destroy): Declarations moved here and
532 deprecated.
533
534 * threads.c: Include <errno.h>. Include "coop-pthreads.c" when
535 requested.
536 (scm_thread_exited_p): New.
537 (scm_try_mutex, scm_broadcast_condition_variable): Newly
538 registered procedures.
539 (scm_wait_condition_variable, scm_timed_wait_condition_variable):
540 Use the latter as the procedure for "wait-condition-variable",
541 thus offering a optional timeout parameter to Scheme.
542 (scm_wait_condition_variable): Implement in terms of
543 scm_timed_wait_condition_variable.
544 (scm_mutex_init, scm_mutex_lock, scm_mutex_trylock,
545 scm_mutex_unlock, scm_mutex_destroy, scm_cond_init,
546 scm_cond_wait, scm_cond_timedwait, scm_cond_signal,
547 scm_cond_broadcast, scm_cond_destroy): Implement in terms of
548 scm_make_mutex, etc, and deprecate.
549 (scm_init_threads): Do not create smobs, leave this to
550 scm_threads_init. Do not include "threads.x" file.
551 (scm_init_thread_procs): New, include "threads.x" here.
552
553 * null-threads.h (scm_null_mutex, scm_null_mutex_init,
554 scm_null_mutex_lock, scm_null_mutex_unlock,
555 scm_null_mutex_destroy, scm_null_condvar, scm_null_condvar_init,
556 scm_null_condvar_wait, scm_null_condvar_signal,
557 scm_null_condvar_destroy): Removed.
558 (scm_mutex_init, scm_mutex_lock, scm_mutex_unlock, scm_cond_init,
559 scm_cond_wait, scm_cond_signal, scm_cond_broadcast,
560 scm_cond_destory): Do not define, they are now deprecated and
561 handled by threads.{h,c}.
562
563 * null-threads.c (scm_null_mutex, scm_null_cond): Define here.
564 (scm_threads_init): Create smobs here, using the appropriate
565 sizes.
566 (block): Removed, now unused.
567 (scm_c_thread_exited_p): New.
568 (scm_null_mutex_init, scm_null_mutex_lock, scm_null_mutex_unlock,
569 scm_null_mutex_destroy, scm_null_condvar_init,
570 scm_null_condvar_wait, scm_null_condvar_signal,
571 scm_null_condvar_destroy): Removed and updated users to do their
572 task directly.
573 (scm_try_mutex, timeval_subtract,
574 scm_timed_wait_condition_variable,
575 scm_broadcast_condition_variable): New.
576 (scm_wait_condition_variable): Removed.
577
578 * coop-defs.h (coop_m): Added 'level' field.
579 (scm_t_mutex, scm_mutex_init, scm_mutex_lock, scm_mutex_trylock,
580 scm_mutex_unlock, scm_mutex_destroy, scm_t_cond, scm_cond_init,
581 scm_cond_wait, scm_cond_timedwait, scm_cond_signal,
582 scm_cond_broadcast, scm_cond_destroy, struct timespec): Do not
583 define.
584 (coop_condition_variable_broadcast): New.
585
586 * coop-threads.c (scm_threads_init): Create smobs here, using the
587 appropriate sizes.
588 (scm_c_thread_exited_p, scm_try_mutex,
589 scm_timed_wait_condition_variable,
590 scm_broadcast_condition_variable): New.
591 (scm_wait_condition_variable): Removed.
592
593 * coop.c (coop_new_mutex_init): Initialize level.
594 (coop_mutex_trylock, coop_mutex_lock, coop_mutex_unlock): maintain
595 level.
596 (coop_condition_variable_signal): Renamed to
597 coop_condition_variable_broadcast and reimplemented in terms of
598 that. Thus...
599 (coop_condition_variable_broadcast): New.
600
601 * goops.c (hell_mutex): Reimplemented using scm_make_mutex, etc.
602
603 * coop-pthreads.h, coop-pthreads.c: New, but unfinished.
604
087ed40d
MV
6052002-10-21 Marius Vollmer <mvo@zagadka.ping.de>
606
65a23095
MV
607 * null-threads.c: Include <time.h>. Also, use <...> for inclusion
608 of system headers.
609
087ed40d
MV
610 * async.c, goops.h, modules.h, validate.h (SCM_MAKE_VALIDATE_MSG):
611 New. Use it instead of SCM_MAKE_VALIDATE in lots of places to
30f920c3 612 give better error messages. Thanks to Bill Schottstaedt!
087ed40d 613
5ec1d2c8
DH
6142002-10-19 Dirk Herrmann <D.Herrmann@tu-bs.de>
615
616 * evalext.h, evalext.c (scm_definedp, scm_defined_p): Renamed
617 scm_definedp to scm_defined_p and deprecated scm_definedp.
618
100ae50d
DH
6192002-10-19 Dirk Herrmann <D.Herrmann@tu-bs.de>
620
621 * async.h, async.c (scm_system_async): Fixed deprecation to work
622 correctly when deprecated features are excluded.
623
2794cb50
MV
6242002-10-16 Marius Vollmer <marius.vollmer@uni-dortmund.de>
625
626 * async.c (scm_system_async_mark_for_thread): Validate thread
627 argument.
628
629 * coop-threads.c (scm_i_thread_root): Do not validate argument.
630
631 * feature.c (scm_init_feature): Don't add 'threads' for
632 USE_NULL_THREADS.
633
634 * inline.h (scm_cell, scm_double_cell): Also allow
635 USE_NULL_THREADS to not protect the slot initializers.
636
637 * scmsigs.c (scm_sigaction_for_thread): It's "USE_THREADS" not
638 "USE_THREAD".
639
640 * Makefile.am (noinst_HEADERS): Added null-threads.c.
641 (modinclude_HEADERS): Added null-threads.h.
642
643 * threads.h: Include null-threads.h when !USE_COOP_THREADS.
644 * threads.c: Include null-threads.c when !USE_COOP_THREADS.
645 (scm_init_threads): Use generic type names scm_t_mutex and
646 scm_t_cond instead of coop_m and coop_c.
647
648 * null-threads.c, null-threads.h: New files.
649
ff810d7a
MV
6502002-10-15 Marius Vollmer <mvo@zagadka.ping.de>
651
652 * Makefile.am: Replaced "$<" in non-pattern rules with its value.
653 This is to support makes that know about "$<" only in pattern
654 rules, like Sun's make.
655
a90bdb73
MV
6562002-10-13 Marius Vollmer <mvo@zagadka.ping.de>
657
658 * Makefile.am (libpath.h): Fixed typo in top_srcdir_absolute
659 substitution. Thanks to David Allouche!
660
e71a8bf2
DH
6612002-10-13 Dirk Herrmann <D.Herrmann@tu-bs.de>
662
663 * evalext.h: Replaced SCM_DEBUG_DEPRECATED with
664 !SCM_ENABLE_DEPRECATED.
665
41f77ff5
MV
6662002-10-11 Marius Vollmer <marius.vollmer@uni-dortmund.de>
667
504d99c5 668 * async.c (scm_system_async_mark_for_thread): Only call
41f77ff5
MV
669 scm_i_thread_root when USE_THREADS is defined. Use scm_root
670 otherwise.
671
672 * scmsigs.c (take_signal): Only call scm_i_thread_root when
673 USE_THREADS is defined. Use scm_root otherwise.
674 (scm_sigaction_for_thread): Ignore THREAD argument when
675 USE_THREADS is not defined. Also, move THREAD argument defaulting
676 out of HAVE_SIGACTION section, which was a bug.
677
6d16b125
MV
6782002-10-10 Marius Vollmer <marius.vollmer@uni-dortmund.de>
679
680 * scmsigs.c (scm_sigaction_for_thread): Store original handler in
681 signal_handlers, not the closure that is used as the async.
682 The closure is stored in signal_handler_cells, as previously.
683
acfa1f52
MV
6842002-10-10 Marius Vollmer <mvo@zagadka.ping.de>
685
686 * root.h (scm_root_state): Added 'block_async' slot.
687 (scm_active_asyncs): Removed abbrev.
688 * root.c (scm_make_root): Initialize 'block_asyncs' slot.
689
690 * __scm.h (SCM_ASYNC_TICK): Do without the scm_active_asyncs
691 abbrev.
692
693 * async.h (scm_call_with_blocked_asyncs,
694 scm_call_with_unblocked_asyncs, scm_c_call_with_blocked_asyncs,
695 scm_c_call_with_unblocked_asyncs): New prototypes.
696 (scm_mask_signals, scm_unmask_signals): Deprecated.
697 (scm_mask_ints): Turned into a macro.
698 * async.c (scm_mask_ints): Removed.
699 (scm_run_asyncs): Do not set scm_mask_ints while running an async.
700 this should not be necessary.
701 (scm_async_click): Test block_asyncs instead of scm_mask_ints.
702 (scm_mask_signals, scm_unmask_signals): Deprecated. Emit
703 deprecation warning and check for errornous use. Set block_asyncs
704 instead of scm_mask_ints.
705 (increase_block, decrease_block, scm_call_with_blocked_asyncs,
706 scm_call_with_unblocked_asyncs, scm_c_call_with_blocked_asyncs,
707 scm_c_call_with_unblocked_asyncs): New.
708
709 * script.c (scm_compile_shell_switches): Do not set scm_mask_ints.
710 Asyncs are enabled by default.
711
34010f56
NJ
7122002-10-09 Neil Jerram <neil@ossau.uklinux.net>
713
714 * vports.c (scm_make_soft_port): Allow vector argument to carry a
715 6th element: an input waiting thunk.
716 (sf_input_waiting): New.
717
9310d6f2
MV
7182002-10-05 Marius Vollmer <mvo@zagadka.ping.de>
719
720 * root.c (root_mark): Mark active_asyncs slot.
721
722 * async.c (scm_async_click): Set the cdr of a executed handler
723 cell to SCM_BOOL_F, not SCM_EOL.
724 (scm_i_queue_async_cell): Queue the cell at the end of the list,
725 and only if the handler procedure is not already present.
726 (scm_system_async_mark_for_thread): Initialize cdr of handler cell
727 with SCM_BOOL_F.
728 * scmsigs.c (scm_sigaction_for_thread): Likewise.
729
ac48c719
RB
7302002-10-04 Rob Browning <rlb@defaultvalue.org>
731
1360a142
RB
732 * guile.c (main): switch to scm_lt_dlset_preloaded_symbols;
733
734 * dynl.c (sysdep_dynl_link): switch to scm_lt_dlhandle,
735 scm_lt_dlopenext, and scm_lt_dlerror.
736 (sysdep_dynl_unlink): switch to scm_lt_dlhandle, scm_lt_dlclose,
737 and scm_lt_dlerror.
738 (sysdep_dynl_func): switch to scm_lt_dlhandle, scm_lt_dlsym,
739 and scm_lt_dlerror.
740 (sysdep_dynl_init): switch to scm_lt_dlinit();
741
742 * Makefile.am (libguile_la_LIBADD): switch to use
743 libguile-ltdl.la.
744
504d99c5 745 * numbers.c (scm_integer_expt): (expt 0 1) should be 1.
ac48c719 746
497092c9
MV
7472002-10-04 Marius Vollmer <mvo@zagadka.ping.de>
748
749 * scmsigs.h (scm_sigaction_for_thread): New prototype.
750 * scmsigs.c (got_signal): Removed.
751 (signal_handler_cells, signal_handler_threads): New.
752 (take_signal): Queue the cell of the signal for the specified
753 thread. Reset the signal handler on systems that don't have
754 sigaction.
755 (sys_deliver_signals): Removed.
756 (close_1): New.
757 (scm_sigaction_for_thread): Renamed from scm_sigaction and
758 extended to also set the thread of a signal and allocate a cell
759 for it. Keep the Scheme name "sigaction". Check that signum is
760 within range. Also, use SCM_VECTOR_REF instead of SCM_VELTS.
761 (scm_sigaction): Implement in terms of scm_sigaction_for_thread.
762 (scm_init_scmsigs): Allocate signal_handler_cells and
763 signal_handler_threads vectors.
764
765 * async.c: Removed GUILE_OLD_ASYNC_CLICK code. Reorganized so
766 that system asnycs and user asyncs are separated. Reimplemented
767 system asyncs to work per-thread.
768
769 * gc.c (scm_init_gc): Do not use scm_system_async.
770
771 * async.h (scm_asyncs_pending, scm_set_tick_rate,
772 scm_set_switch_rate, scm_system_async_mark_from_signal_handler):
773 Removed prototypes.
774 (scm_i_queue_async_cell): New.
775
776 * __scm.h (scm_asyncs_pending_p): Removed.
777 (SCM_ASYNC_CLICK): Check scm_active_asyncs instead of
778 scm_asyncs_pending_p.
779
780 * async.h (scm_system_async_mark_for_thread): New prototype.
781
782 * __scm.h: Removed GUILE_OLD_ASYNC_CLICK code.
783
784 * root.h (scm_root_state): Added new "active_asyncs" slot.
785 * root.c (scm_make_root): Initialize it to SCM_EOL.
786
787 * coop-defs.h (coop_t): Added new "handle" slot.
788 * coop-threads.c (all_threads, scm_current_thread,
789 scm_all_threads, scm_i_thread_root): New.
790 (scm_threads_init): Add main thread to all_threads.
791 (scheme_launch_thread): Remove thread from all_threads when it
792 terminates.
793 (scm_call_with_new_thread): Initialize handle slot of coop_t
794 structure and add new thread to all_threads.
795 (scm_spawn_thread): Likewise.
796
797 * threads.h (scm_current_thread, scm_all_threads): New prototypes.
798 * threads.c (scm_current_thread, scm_all_threads): Register as
799 primitives.
800
801 * dynl.c: Use scm_lt_ prefix for libltdl functions.
802
480fa28d
NJ
8032002-09-29 Neil Jerram <neil@ossau.uklinux.net>
804
805 * script.c (scm_compile_shell_switches): Fix bad spelling of
806 `explicitly' in comment.
807
8082002-09-28 Neil Jerram <neil@ossau.uklinux.net>
809
810 * posix.c (scm_geteuid, scm_getegid, scm_seteuid, scm_setegid):
811 Refer to provided? in doc string rather than deprecated feature?.
812
3553e1d1
GH
8132002-09-24 Gary Houston <ghouston@arglist.com>
814
815 * inline.h (scm_double_cell): prevent reordering of statements
816 with any following code (for GCC 3 strict-aliasing).
817 * numbers.c (scm_make_real), num2float.i.c (FLOAT2NUM): removed
818 the earlier version of the reordering prevention.
819
4ad0814a
HWN
8202002-09-19 Han-Wen Nienhuys <hanwen@cs.uu.nl>
821
822 * inline.h (scm_double_cell): move SET_GCMARK set out of if body.
823
e88e4f2e
HWN
8242002-09-09 Han-Wen Nienhuys <hanwen@cs.uu.nl>
825
826 * gc-malloc.c (scm_gc_register_collectable_memory): more overflow
827 protection.
828
1e71eafb
HWN
8292002-09-08 Han-Wen Nienhuys <hanwen@cs.uu.nl>
830
831 * inline.h: include stdio.h
832
833 * smob.c (free_print): abort if scm_debug_cell_accesses_p is set
834
61ef9c1f
HWN
8352002-09-05 Han-Wen Nienhuys <hanwen@cs.uu.nl>
836
dac04e9f
HWN
837 * gc-segment.c (scm_i_make_initial_segment): check user settings
838 for sanity.
839
840 * gc-malloc.c (scm_gc_init_malloc): check user settings for
841 sanity.
dac04e9f
HWN
842
843 * gc-freelist.c (scm_init_freelist): check user settings for sanity.
844
ffd72400
HWN
845 * struct.h: change scm_structs_to_free to scm_i_structs_to_free
846
847 * gc-malloc.c (scm_gc_register_collectable_memory): use floats;
1e71eafb
HWN
848 these won't ever wrap around with high memory usage. Thanks to
849 Sven Hartrumpf for finding this.
ffd72400 850
5bd4a949
HWN
851 * gc-freelist.c: include <stdio.h>
852
61ef9c1f
HWN
853 * gc-malloc.c: add DEBUGINFO for mtrigger GCs.
854
ffd0ef3b
MV
8552002-09-01 Marius Vollmer <mvo@zagadka.ping.de>
856
a27e3d14
MV
857 * vectors.h (SCM_VECTOR_REF): New.
858
ffd0ef3b
MV
859 * snarf.h (SCM_DEFINE_PUBLIC): New.
860
f8a1712b
MV
8612002-08-30 Marius Vollmer <mvo@zagadka.ping.de>
862
863 * socket.c (scm_addr_vector): Added size of address to arguments.
864 Use it to avoid accessing a non-existent path in a sockaddr_un.
865 Changed all callers.
866
7200a36b
HWN
8672002-08-29 Han-Wen Nienhuys <hanwen@cs.uu.nl>
868
1383773b
HWN
869 * gc.h: remove DOUBLECELL card flags.
870
871 * gc-malloc.c (scm_calloc): try to use calloc() before calling
872 scm_realloc().
873
874 * gc-segment.c (scm_i_initialize_heap_segment_data): remove card
875 init loop; handle this from scm_init_card_freelist()
876
877 * gc-card.c (scm_init_card_freelist): init bit vector here.
878
7200a36b 879 * numbers.c (scm_make_real): prevent reordering of statements
8fa5786d 880 num2float.i.c (FLOAT2NUM): idem
7200a36b 881
9981de3a
HWN
8822002-08-27 Han-Wen Nienhuys <hanwen@cs.uu.nl>
883
884 * eval.h: prepend libguile/ to include path
885
19647556
MV
8862002-08-26 Marius Vollmer <mvo@zagadka.ping.de>
887
888 * script.c (scm_compile_shell_switches): Added "2002" to Copyright
889