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