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