(USE_THREADS, GUILE_ISELECT): Define always. We define them with
[bpt/guile.git] / libguile / ChangeLog
CommitLineData
e5a83084
MD
12002-11-07 Mikael Djurfeldt <mdj@linnaeus>
2
9be8bb45
MD
3 * coop-pthreads.h: Added support for thread specific data to the
4 generic C API for the coop-pthreads case.
5
e5a83084
MD
6 * threads.c, threads.h (scm_cond_init): Undo unintentional API
7 change.
6c214b62 8 (scm_cond_broadcast): Added missing function.
e5a83084 9
7edf178e
MV
102002-11-04 Marius Vollmer <marius.vollmer@uni-dortmund.de>
11
12 * coop.c (coop_next_runnable_thread): Removed, wich should have
13 happened when GUILE_ISELECT was hard-wired.
14
7f5b1b77
MV
152002-11-03 Marius Vollmer <mvo@zagadka.ping.de>
16
7caa1b07
MV
17 * Makefile.am (libguile_la_SOURCES): Added threads.c
18 (DOT_DOC_FILES): Added threads.doc.
19 (DOT_X_FILES): Added threads.x.
20 (EXTRA_libguile_la_SOURCES): Removed threads.c.
21 (noinst_HEADERS): Added coop-pthreads.c.
22 (modinclude_HEADERS): Added coop-pthreads.h.
23
24 * __scm.h (USE_THREADS, GUILE_ISELECT): Define when
25 SCM_DEBUG_DEPRECATED. Removed their use thru-out Guile.
26
bb11cbf4
MV
27 * iselect.c: Include "_scm.h" before testing HAVE_UNISTD_H.
28 Thanks to Bill Schottstaedt!
29
1d4cbbed
MV
30 * numbers.c (scm_integer_expt): Make 0^z == 0 for z != 0.
31
7f5b1b77
MV
32 * _scm.h (HAVE_RESTARTABLE_SYSCALLS): Do define even when
33 SCM_COPT_THREADS is defined.
34 (SCM_SYSCALL): Use EINTR-expection version when SCM_COPT_THREADS
35 is defined.
36
37 * coop-pthreads.c: Some harmless renamings of internal stuff.
38 (create_thread): New, generalized version of
39 scm_call_with_new_thread.
40 (scm_call_with_new_thread): Use it.
41 (scm_spawn_thread): New, use create_thread.
42
d52f53b1
MV
432002-11-02 Marius Vollmer <mvo@zagadka.ping.de>
44
45 * coop-pthreads.c, coop-pthreads.h: Redone completely, you might
46 start testing it now.
47
48 * _scm.h: Include <errno.h< so that SCM_SYSCALL is correctly
49 defined when HAVE_RESTARTABLE_SYSCALLS is not defined.
50 (HAVE_RESTARTABLE_SYSCALLS): Do not define when USE_COPT_THREADS
51 is defined.
52
30f920c3
MV
532002-10-27 Marius Vollmer <mvo@zagadka.ping.de>
54
55 * scmsigs.c (signal_cell_handlers, install_handler_data,
56 scm_delq_spine_x, really_install_handler, install_handler): New
57 scheme for triggering signal handlers, to simplify take_signal.
58 (take_signal): Simplified, to avoid race conditions.
59 (scm_sigaction_for_thread): Use new Scheme. Validate that thread
60 hasn't exited yet.
61
62 * async.c (scm_async_click): Reset pending_asyncs, handle
63 signal_asyncs. Don't set cdr of a non-signal async to #f.
64 (scm_i_queue_async_cell): Do not check cdr of cell for #f, queue
65 always. Set pending_asyncs.
66 (scm_system_async_mark_for_thread): Check that thread has not
67 exited.
68 (scm_unmask_signals, decrease_block): Call scm_async_click after
69 block_asyncs becomes zero.
70
71 * __scm.h (SCM_ASYNC_CLICK): Check pending_asyncs instead of
72 active_asyncs.
73
74 * root.h (scm_root_state): Added pending_asyncs and signal_asyncs
75 fields.
76 * root.c (root_mark): Mark them.
77 (make_root): Initialize them.
78
79 * iselect.c, iselect.h: Replaced GUILE_ISELECT with
80 USE_COOP_THREADS.
81 (scm_internal_select): Define one version for USE_COOP_THREADS and
82 one for USE_NULL_THREADS.
83 (scm_init_iselect): Likewise.
84
85 * inline.h (scm_cell, scm_double_cell): Also allow
86 USE_COPT_THREADS to not protect the slot initializers.
87
88 * init.c (scm_init_guile_1): Call scm_init_thread_procs. This is
89 because threads need to be initialized before the stack, but
90 gsubrs such as scm_timed_condition_variable_wait can only be
91 created later.
92
93 * threads.h: Include "coop-pthreads.h" when requested.
94 (scm_threads_make_mutex, scm_threads_lock_mutex,
95 scm_threads_unlock_mutex, scm_threads_monitor): Removed, they were
96 not implemented anyway.
97 (scm_init_thread_procs, scm_try_mutex,
98 scm_timed_condition_variable_wait,
99 scm_broadcast_condition_variable, scm_c_thread_exited_p,
100 scm_thread_exited_p): New prototypes.
101 (struct timespec): Define if not already defined.
102 (scm_t_mutex, scm_mutex_init, scm_mutex_lock, scm_mutex_trylock,
103 scm_mutex_unlock, scm_mutex_destroy, scm_t_cond, scm_cond_init,
104 scm_cond_wait, scm_cond_timedwait, scm_cond_signal,
105 scm_cond_broadcast, scm_cond_destroy): Declarations moved here and
106 deprecated.
107
108 * threads.c: Include <errno.h>. Include "coop-pthreads.c" when
109 requested.
110 (scm_thread_exited_p): New.
111 (scm_try_mutex, scm_broadcast_condition_variable): Newly
112 registered procedures.
113 (scm_wait_condition_variable, scm_timed_wait_condition_variable):
114 Use the latter as the procedure for "wait-condition-variable",
115 thus offering a optional timeout parameter to Scheme.
116 (scm_wait_condition_variable): Implement in terms of
117 scm_timed_wait_condition_variable.
118 (scm_mutex_init, scm_mutex_lock, scm_mutex_trylock,
119 scm_mutex_unlock, scm_mutex_destroy, scm_cond_init,
120 scm_cond_wait, scm_cond_timedwait, scm_cond_signal,
121 scm_cond_broadcast, scm_cond_destroy): Implement in terms of
122 scm_make_mutex, etc, and deprecate.
123 (scm_init_threads): Do not create smobs, leave this to
124 scm_threads_init. Do not include "threads.x" file.
125 (scm_init_thread_procs): New, include "threads.x" here.
126
127 * null-threads.h (scm_null_mutex, scm_null_mutex_init,
128 scm_null_mutex_lock, scm_null_mutex_unlock,
129 scm_null_mutex_destroy, scm_null_condvar, scm_null_condvar_init,
130 scm_null_condvar_wait, scm_null_condvar_signal,
131 scm_null_condvar_destroy): Removed.
132 (scm_mutex_init, scm_mutex_lock, scm_mutex_unlock, scm_cond_init,
133 scm_cond_wait, scm_cond_signal, scm_cond_broadcast,
134 scm_cond_destory): Do not define, they are now deprecated and
135 handled by threads.{h,c}.
136
137 * null-threads.c (scm_null_mutex, scm_null_cond): Define here.
138 (scm_threads_init): Create smobs here, using the appropriate
139 sizes.
140 (block): Removed, now unused.
141 (scm_c_thread_exited_p): New.
142 (scm_null_mutex_init, scm_null_mutex_lock, scm_null_mutex_unlock,
143 scm_null_mutex_destroy, scm_null_condvar_init,
144 scm_null_condvar_wait, scm_null_condvar_signal,
145 scm_null_condvar_destroy): Removed and updated users to do their
146 task directly.
147 (scm_try_mutex, timeval_subtract,
148 scm_timed_wait_condition_variable,
149 scm_broadcast_condition_variable): New.
150 (scm_wait_condition_variable): Removed.
151
152 * coop-defs.h (coop_m): Added 'level' field.
153 (scm_t_mutex, scm_mutex_init, scm_mutex_lock, scm_mutex_trylock,
154 scm_mutex_unlock, scm_mutex_destroy, scm_t_cond, scm_cond_init,
155 scm_cond_wait, scm_cond_timedwait, scm_cond_signal,
156 scm_cond_broadcast, scm_cond_destroy, struct timespec): Do not
157 define.
158 (coop_condition_variable_broadcast): New.
159
160 * coop-threads.c (scm_threads_init): Create smobs here, using the
161 appropriate sizes.
162 (scm_c_thread_exited_p, scm_try_mutex,
163 scm_timed_wait_condition_variable,
164 scm_broadcast_condition_variable): New.
165 (scm_wait_condition_variable): Removed.
166
167 * coop.c (coop_new_mutex_init): Initialize level.
168 (coop_mutex_trylock, coop_mutex_lock, coop_mutex_unlock): maintain
169 level.
170 (coop_condition_variable_signal): Renamed to
171 coop_condition_variable_broadcast and reimplemented in terms of
172 that. Thus...
173 (coop_condition_variable_broadcast): New.
174
175 * goops.c (hell_mutex): Reimplemented using scm_make_mutex, etc.
176
177 * coop-pthreads.h, coop-pthreads.c: New, but unfinished.
178
087ed40d
MV
1792002-10-21 Marius Vollmer <mvo@zagadka.ping.de>
180
65a23095
MV
181 * null-threads.c: Include <time.h>. Also, use <...> for inclusion
182 of system headers.
183
087ed40d
MV
184 * async.c, goops.h, modules.h, validate.h (SCM_MAKE_VALIDATE_MSG):
185 New. Use it instead of SCM_MAKE_VALIDATE in lots of places to
30f920c3 186 give better error messages. Thanks to Bill Schottstaedt!
087ed40d 187
5ec1d2c8
DH
1882002-10-19 Dirk Herrmann <D.Herrmann@tu-bs.de>
189
190 * evalext.h, evalext.c (scm_definedp, scm_defined_p): Renamed
191 scm_definedp to scm_defined_p and deprecated scm_definedp.
192
100ae50d
DH
1932002-10-19 Dirk Herrmann <D.Herrmann@tu-bs.de>
194
195 * async.h, async.c (scm_system_async): Fixed deprecation to work
196 correctly when deprecated features are excluded.
197
2794cb50
MV
1982002-10-16 Marius Vollmer <marius.vollmer@uni-dortmund.de>
199
200 * async.c (scm_system_async_mark_for_thread): Validate thread
201 argument.
202
203 * coop-threads.c (scm_i_thread_root): Do not validate argument.
204
205 * feature.c (scm_init_feature): Don't add 'threads' for
206 USE_NULL_THREADS.
207
208 * inline.h (scm_cell, scm_double_cell): Also allow
209 USE_NULL_THREADS to not protect the slot initializers.
210
211 * scmsigs.c (scm_sigaction_for_thread): It's "USE_THREADS" not
212 "USE_THREAD".
213
214 * Makefile.am (noinst_HEADERS): Added null-threads.c.
215 (modinclude_HEADERS): Added null-threads.h.
216
217 * threads.h: Include null-threads.h when !USE_COOP_THREADS.
218 * threads.c: Include null-threads.c when !USE_COOP_THREADS.
219 (scm_init_threads): Use generic type names scm_t_mutex and
220 scm_t_cond instead of coop_m and coop_c.
221
222 * null-threads.c, null-threads.h: New files.
223
ff810d7a
MV
2242002-10-15 Marius Vollmer <mvo@zagadka.ping.de>
225
226 * Makefile.am: Replaced "$<" in non-pattern rules with its value.
227 This is to support makes that know about "$<" only in pattern
228 rules, like Sun's make.
229
a90bdb73
MV
2302002-10-13 Marius Vollmer <mvo@zagadka.ping.de>
231
232 * Makefile.am (libpath.h): Fixed typo in top_srcdir_absolute
233 substitution. Thanks to David Allouche!
234
e71a8bf2
DH
2352002-10-13 Dirk Herrmann <D.Herrmann@tu-bs.de>
236
237 * evalext.h: Replaced SCM_DEBUG_DEPRECATED with
238 !SCM_ENABLE_DEPRECATED.
239
41f77ff5
MV
2402002-10-11 Marius Vollmer <marius.vollmer@uni-dortmund.de>
241
242 * async.c (s_scm_system_async_mark_for_thread): Only call
243 scm_i_thread_root when USE_THREADS is defined. Use scm_root
244 otherwise.
245
246 * scmsigs.c (take_signal): Only call scm_i_thread_root when
247 USE_THREADS is defined. Use scm_root otherwise.
248 (scm_sigaction_for_thread): Ignore THREAD argument when
249 USE_THREADS is not defined. Also, move THREAD argument defaulting
250 out of HAVE_SIGACTION section, which was a bug.
251
6d16b125
MV
2522002-10-10 Marius Vollmer <marius.vollmer@uni-dortmund.de>
253
254 * scmsigs.c (scm_sigaction_for_thread): Store original handler in
255 signal_handlers, not the closure that is used as the async.
256 The closure is stored in signal_handler_cells, as previously.
257
acfa1f52
MV
2582002-10-10 Marius Vollmer <mvo@zagadka.ping.de>
259
260 * root.h (scm_root_state): Added 'block_async' slot.
261 (scm_active_asyncs): Removed abbrev.
262 * root.c (scm_make_root): Initialize 'block_asyncs' slot.
263
264 * __scm.h (SCM_ASYNC_TICK): Do without the scm_active_asyncs
265 abbrev.
266
267 * async.h (scm_call_with_blocked_asyncs,
268 scm_call_with_unblocked_asyncs, scm_c_call_with_blocked_asyncs,
269 scm_c_call_with_unblocked_asyncs): New prototypes.
270 (scm_mask_signals, scm_unmask_signals): Deprecated.
271 (scm_mask_ints): Turned into a macro.
272 * async.c (scm_mask_ints): Removed.
273 (scm_run_asyncs): Do not set scm_mask_ints while running an async.
274 this should not be necessary.
275 (scm_async_click): Test block_asyncs instead of scm_mask_ints.
276 (scm_mask_signals, scm_unmask_signals): Deprecated. Emit
277 deprecation warning and check for errornous use. Set block_asyncs
278 instead of scm_mask_ints.
279 (increase_block, decrease_block, scm_call_with_blocked_asyncs,
280 scm_call_with_unblocked_asyncs, scm_c_call_with_blocked_asyncs,
281 scm_c_call_with_unblocked_asyncs): New.
282
283 * script.c (scm_compile_shell_switches): Do not set scm_mask_ints.
284 Asyncs are enabled by default.
285
34010f56
NJ
2862002-10-09 Neil Jerram <neil@ossau.uklinux.net>
287
288 * vports.c (scm_make_soft_port): Allow vector argument to carry a
289 6th element: an input waiting thunk.
290 (sf_input_waiting): New.
291
9310d6f2
MV
2922002-10-05 Marius Vollmer <mvo@zagadka.ping.de>
293
294 * root.c (root_mark): Mark active_asyncs slot.
295
296 * async.c (scm_async_click): Set the cdr of a executed handler
297 cell to SCM_BOOL_F, not SCM_EOL.
298 (scm_i_queue_async_cell): Queue the cell at the end of the list,
299 and only if the handler procedure is not already present.
300 (scm_system_async_mark_for_thread): Initialize cdr of handler cell
301 with SCM_BOOL_F.
302 * scmsigs.c (scm_sigaction_for_thread): Likewise.
303
ac48c719
RB
3042002-10-04 Rob Browning <rlb@defaultvalue.org>
305
1360a142
RB
306 * guile.c (main): switch to scm_lt_dlset_preloaded_symbols;
307
308 * dynl.c (sysdep_dynl_link): switch to scm_lt_dlhandle,
309 scm_lt_dlopenext, and scm_lt_dlerror.
310 (sysdep_dynl_unlink): switch to scm_lt_dlhandle, scm_lt_dlclose,
311 and scm_lt_dlerror.
312 (sysdep_dynl_func): switch to scm_lt_dlhandle, scm_lt_dlsym,
313 and scm_lt_dlerror.
314 (sysdep_dynl_init): switch to scm_lt_dlinit();
315
316 * Makefile.am (libguile_la_LIBADD): switch to use
317 libguile-ltdl.la.
318
ac48c719
RB
319 * numbers.c (s_scm_integer_expt): (expt 0 1) should be 1.
320
497092c9
MV
3212002-10-04 Marius Vollmer <mvo@zagadka.ping.de>
322
323 * scmsigs.h (scm_sigaction_for_thread): New prototype.
324 * scmsigs.c (got_signal): Removed.
325 (signal_handler_cells, signal_handler_threads): New.
326 (take_signal): Queue the cell of the signal for the specified
327 thread. Reset the signal handler on systems that don't have
328 sigaction.
329 (sys_deliver_signals): Removed.
330 (close_1): New.
331 (scm_sigaction_for_thread): Renamed from scm_sigaction and
332 extended to also set the thread of a signal and allocate a cell
333 for it. Keep the Scheme name "sigaction". Check that signum is
334 within range. Also, use SCM_VECTOR_REF instead of SCM_VELTS.
335 (scm_sigaction): Implement in terms of scm_sigaction_for_thread.
336 (scm_init_scmsigs): Allocate signal_handler_cells and
337 signal_handler_threads vectors.
338
339 * async.c: Removed GUILE_OLD_ASYNC_CLICK code. Reorganized so
340 that system asnycs and user asyncs are separated. Reimplemented
341 system asyncs to work per-thread.
342
343 * gc.c (scm_init_gc): Do not use scm_system_async.
344
345 * async.h (scm_asyncs_pending, scm_set_tick_rate,
346 scm_set_switch_rate, scm_system_async_mark_from_signal_handler):
347 Removed prototypes.
348 (scm_i_queue_async_cell): New.
349
350 * __scm.h (scm_asyncs_pending_p): Removed.
351 (SCM_ASYNC_CLICK): Check scm_active_asyncs instead of
352 scm_asyncs_pending_p.
353
354 * async.h (scm_system_async_mark_for_thread): New prototype.
355
356 * __scm.h: Removed GUILE_OLD_ASYNC_CLICK code.
357
358 * root.h (scm_root_state): Added new "active_asyncs" slot.
359 * root.c (scm_make_root): Initialize it to SCM_EOL.
360
361 * coop-defs.h (coop_t): Added new "handle" slot.
362 * coop-threads.c (all_threads, scm_current_thread,
363 scm_all_threads, scm_i_thread_root): New.
364 (scm_threads_init): Add main thread to all_threads.
365 (scheme_launch_thread): Remove thread from all_threads when it
366 terminates.
367 (scm_call_with_new_thread): Initialize handle slot of coop_t
368 structure and add new thread to all_threads.
369 (scm_spawn_thread): Likewise.
370
371 * threads.h (scm_current_thread, scm_all_threads): New prototypes.
372 * threads.c (scm_current_thread, scm_all_threads): Register as
373 primitives.
374
375 * dynl.c: Use scm_lt_ prefix for libltdl functions.
376
480fa28d
NJ
3772002-09-29 Neil Jerram <neil@ossau.uklinux.net>
378
379 * script.c (scm_compile_shell_switches): Fix bad spelling of
380 `explicitly' in comment.
381
3822002-09-28 Neil Jerram <neil@ossau.uklinux.net>
383
384 * posix.c (scm_geteuid, scm_getegid, scm_seteuid, scm_setegid):
385 Refer to provided? in doc string rather than deprecated feature?.
386
3553e1d1
GH
3872002-09-24 Gary Houston <ghouston@arglist.com>
388
389 * inline.h (scm_double_cell): prevent reordering of statements
390 with any following code (for GCC 3 strict-aliasing).
391 * numbers.c (scm_make_real), num2float.i.c (FLOAT2NUM): removed
392 the earlier version of the reordering prevention.
393
4ad0814a
HWN
3942002-09-19 Han-Wen Nienhuys <hanwen@cs.uu.nl>
395
396 * inline.h (scm_double_cell): move SET_GCMARK set out of if body.
397
e88e4f2e
HWN
3982002-09-09 Han-Wen Nienhuys <hanwen@cs.uu.nl>
399
400 * gc-malloc.c (scm_gc_register_collectable_memory): more overflow
401 protection.
402
1e71eafb
HWN
4032002-09-08 Han-Wen Nienhuys <hanwen@cs.uu.nl>
404
405 * inline.h: include stdio.h
406
407 * smob.c (free_print): abort if scm_debug_cell_accesses_p is set
408
61ef9c1f
HWN
4092002-09-05 Han-Wen Nienhuys <hanwen@cs.uu.nl>
410
dac04e9f
HWN
411 * gc-segment.c (scm_i_make_initial_segment): check user settings
412 for sanity.
413
414 * gc-malloc.c (scm_gc_init_malloc): check user settings for
415 sanity.
dac04e9f
HWN
416
417 * gc-freelist.c (scm_init_freelist): check user settings for sanity.
418
ffd72400
HWN
419 * struct.h: change scm_structs_to_free to scm_i_structs_to_free
420
421 * gc-malloc.c (scm_gc_register_collectable_memory): use floats;
1e71eafb
HWN
422 these won't ever wrap around with high memory usage. Thanks to
423 Sven Hartrumpf for finding this.
ffd72400 424
5bd4a949
HWN
425 * gc-freelist.c: include <stdio.h>
426
61ef9c1f
HWN
427 * gc-malloc.c: add DEBUGINFO for mtrigger GCs.
428
ffd0ef3b
MV
4292002-09-01 Marius Vollmer <mvo@zagadka.ping.de>
430
a27e3d14
MV
431 * vectors.h (SCM_VECTOR_REF): New.
432
ffd0ef3b
MV
433 * snarf.h (SCM_DEFINE_PUBLIC): New.
434
f8a1712b
MV
4352002-08-30 Marius Vollmer <mvo@zagadka.ping.de>
436
437 * socket.c (scm_addr_vector): Added size of address to arguments.
438 Use it to avoid accessing a non-existent path in a sockaddr_un.
439 Changed all callers.
440
7200a36b
HWN
4412002-08-29 Han-Wen Nienhuys <hanwen@cs.uu.nl>
442
1383773b
HWN
443 * gc.h: remove DOUBLECELL card flags.
444
445 * gc-malloc.c (scm_calloc): try to use calloc() before calling
446 scm_realloc().
447
448 * gc-segment.c (scm_i_initialize_heap_segment_data): remove card
449 init loop; handle this from scm_init_card_freelist()
450
451 * gc-card.c (scm_init_card_freelist): init bit vector here.
452
7200a36b 453 * numbers.c (scm_make_real): prevent reordering of statements
8fa5786d 454 num2float.i.c (FLOAT2NUM): idem
7200a36b 455
9981de3a
HWN
4562002-08-27 Han-Wen Nienhuys <hanwen@cs.uu.nl>
457
458 * eval.h: prepend libguile/ to include path
459
19647556
MV
4602002-08-26 Marius Vollmer <mvo@zagadka.ping.de>
461
462 * script.c (scm_compile_shell_switches): Added "2002" to Copyright
463