summaryrefslogtreecommitdiff
path: root/libguile/async.c
AgeCommit message (Collapse)AuthorFilesLines
2014-04-25Merge branch 'stable-2.0'v2.1.0Mark H Weaver1-3/+2
Conflicts: GUILE-VERSION NEWS guile-readline/ice-9/readline.scm libguile/async.c libguile/backtrace.c libguile/deprecated.h libguile/gc-malloc.c libguile/gdbint.c libguile/init.c libguile/ioext.c libguile/mallocs.c libguile/print.c libguile/rw.c libguile/scmsigs.c libguile/script.c libguile/simpos.c libguile/snarf.h libguile/strports.c libguile/threads.c libguile/vm-i-scheme.c libguile/vm-i-system.c module/srfi/srfi-18.scm test-suite/Makefile.am test-suite/standalone/test-num2integral.c
2014-02-27Rely on Gnulib for <unistd.h>.Mark H Weaver1-3/+2
* libguile/async.c: * libguile/backtrace.c: * libguile/error.c: * libguile/filesys.c: * libguile/fports.c: * libguile/gc-malloc.c: * libguile/gc.c: * libguile/gdbint.c: * libguile/init.c: * libguile/ioext.c: * libguile/load.c: * libguile/mallocs.c: * libguile/mkstemp.c: * libguile/ports.c: * libguile/posix.c: * libguile/r6rs-ports.c: * libguile/random.c: * libguile/rw.c: * libguile/scmsigs.c: * libguile/script.c: * libguile/simpos.c: * libguile/socket.c: * libguile/stime.c: * libguile/strports.c: * libguile/threads.c: Unconditionally include <unistd.h>.
2012-02-23Revert "install pthread_atfork handlers for guile's static mutexen"Andy Wingo1-2/+1
This reverts commit 6a97b1f93aace5c7c976aef51d36b3ae9cfd5630.
2012-02-17install pthread_atfork handlers for guile's static mutexenAndy Wingo1-1/+2
* libguile/async.c: * libguile/deprecation.c: * libguile/fluids.c: * libguile/gc.c: * libguile/instructions.c: * libguile/ports.c: * libguile/posix.c: * libguile/strings.c: * libguile/threads.c: Use the SCM_PTHREAD_ATFORK_LOCK_STATIC_MUTEX mechanism to lock a number of static mutexen.
2011-05-15rename scm_async_click() to scm_async_tick(); privatize SCM_ASYNC_TICKAndy Wingo1-8/+2
* libguile/_scm.h (SCM_ASYNC_TICK, SCM_ASYNC_TICK_WITH_CODE): Make these definitions private. Call the tick() function instead of click(). * libguile/__scm.h: * libguile/async.h (scm_async_tick): Move declaration here. Remove scm_async_click declaration. Tick is the new (and old!) click, you see. (SCM_CRITICAL_SECTION_END): Call tick() instead of click(). * libguile/async.c (scm_async_tick): Remove old definition, and rename scm_async_click to scm_async_tick. (decrease_block): Adapt to click() -> tick() name change. * libguile/deprecated.h (scm_async_click, SCM_ASYNC_TICK): Define some GONE macros. * libguile/threads.c (fat_mutex_unlock): Tick() instead of click().
2011-05-13merge strictness branch from 2.0Andy Wingo1-39/+55
2011-05-13async.c refactorAndy Wingo1-39/+55
* libguile/async.c (increase_block, decrease_block): Write more clearly. (scm_dynwind_block_asyncs, scm_dynwind_unblock_asyncs): Move definitions up. (scm_call_with_blocked_asyncs, scm_c_call_with_blocked_asyncs) (scm_call_with_unblocked_asyncs, scm_c_call_with_unblocked_asyncs): Implement in terms of scm_dynwind_{un,}block_asyncs, so that we don't stuff SCM values into pointers.
2011-05-12remove all deprecated codeAndy Wingo1-61/+1
* libguile/async.c: * libguile/async.h: * libguile/debug.h: * libguile/deprecated.c: * libguile/deprecated.h: * libguile/evalext.h: * libguile/gc-malloc.c: * libguile/gc.h: * libguile/gen-scmconfig.c: * libguile/numbers.c: * libguile/ports.c: * libguile/ports.h: * libguile/procprop.c: * libguile/procprop.h: * libguile/read.c: * libguile/socket.c: * libguile/srfi-4.h: * libguile/strings.c: * libguile/strings.h: * libguile/tags.h: * module/ice-9/boot-9.scm: * module/ice-9/deprecated.scm: Remove all deprecated code. CPP defines that were not previously issuing warnings were changed so that their expansions would indicate the replacement forms to use, e.g. scm_sizet__GONE__REPLACE_WITH__size_t. The two exceptions were SCM_LISTN, which did not produce warnings before, and the string-filter argument order stuff. Drops the initial dirty memory usage of Guile down to 2.8 MB on my machine, from 4.4 MB.
2010-08-27Assorted `syntax-check' fixes.Ludovic Courtès1-1/+0
* doc/ref/Makefile.am ($(snarf_doc).am): Untabify. * libguile/eval.c: Remove unnecessary <assert.h> inclusion. * .x-sc_m4_quote_check: Update. * libguile/error.c (scm_error_scm): Use `EXIT_FAILURE' instead of 1. * libguile/init.c (fixconfig, scm_boot_guile): Likewise. * libguile/null-threads.h (scm_i_pthread_exit): Likewise. * libguile/script.c (scm_compile_shell_switches): Likewise. * test-suite/standalone/test-conversion.c: Likewise. * test-suite/standalone/test-list.c: Likewise. * test-suite/standalone/test-unwind.c: Likewise. * libguile/async.c: Remove unnecessary inclusion of <signal.h>. * NEWS: "filesystem" -> "file system". * doc/ref/r6rs.texi: Ditto. * cfg.mk (local-checks-to-skip): New variable. * .x-sc_m4_quote_check, .x-sc_obsolete_symbols, .x-sc_program_name, .x-sc_prohibit_atoi_atof, .x-sc_prohibit_magic_number_exit: New files. * .gitignore: Update.
2010-04-09remove libguile/lang.h, deprecate %nil (in favor of #nil)Andy Wingo1-2/+1
* libguile/Makefile.am: * libguile/init.c: * libguile/lang.c: * libguile/lang.h: Remove lang.c and lang.h. * libguile/pairs.h (SCM_NIL_P, SCM_NULL_OR_NIL_P): Moved here. * module/ice-9/deprecated.scm (%nil): %nil definition moved here. * libguile/alist.c: * libguile/async.c: * libguile/backtrace.c: * libguile/boolean.c: * libguile/dynl.c: * libguile/eval.c: * libguile/filesys.c: * libguile/fluids.c: * libguile/list.c: * libguile/load.c: * libguile/options.c: * libguile/posix.c: * libguile/print.c: * libguile/promises.c: * libguile/sort.c: * libguile/throw.c: * libguile/trees.c: * libguile/vectors.c: * libguile/vm.c: * libguile/weaks.c: * srfi/srfi-1.c: <libguile/lang.h> references removed.
2009-12-08fix SCM_CELL_* macro usage in async.cAndy Wingo1-3/+3
* libguile/async.c (ASYNC_GOT_IT, SET_ASYNC_GOT_IT, ASYNC_THUNK): Fix SCM_CELL_* macro usage.
2009-12-05decruftify scm_sys_protectsAndy Wingo1-1/+0
* libguile/root.h * libguile/root.c (scm_sys_protects): It used to be that for some reason we'd define a special array of "protected" values. This was a little silly, always, but with the BDW GC it's completely unnecessary. Also many of these variables were unused, and none of them were good API. So remove this array, and either eliminate, make static, or make internal the various values. * libguile/snarf.h: No need to generate calls to scm_permanent_object. * guile-readline/readline.c (scm_init_readline): No need to call scm_permanent_object. * libguile/array-map.c (ramap, rafe): Remove the dubious nullvect optimizations. * libguile/async.c (scm_init_async): No need to init scm_asyncs, it is no more. * libguile/eval.c (scm_init_eval): No need to init scm_listofnull, it is no more. * libguile/gc.c: Make scm_protects a static var. (scm_storage_prehistory): Change the sanity check to use the address of protects. (scm_init_gc_protect_object): No need to clear the scm_sys_protects, as it is no more. * libguile/keywords.c: Make the keyword obarray a static var. * libguile/numbers.c: Make flo0 a static var. * libguile/objprop.c: Make object_whash a static var. * libguile/properties.c: Make properties_whash a static var. * libguile/srcprop.h: * libguile/srcprop.c: Make scm_source_whash a global with internal linkage. * libguile/strings.h: * libguile/strings.c: Make scm_nullstr a global with internal linkage. * libguile/vectors.c (scm_init_vectors): No need to init scm_nullvect, it's unused.
2009-10-09Arrange so that `SCM_I_CURRENT_THREAD' is not accessed outside of libguile.Ludovic Courtès1-0/+23
* libguile/__scm.h (scm_async_tick): New declaration. (SCM_ASYNC_TICK)[!BUILDING_LIBGUILE]: Use `scm_async_tick ()'. * libguile/async.c (scm_critical_section_start, scm_critical_section_end, scm_async_tick): New functions. * libguile/async.h (scm_i_critical_section_mutex): Made internal. (scm_critical_section_start, scm_critical_section_end): New declarations. (SCM_CRITICAL_SECTION_START, SCM_CRITICAL_SECTION_END)[!BUILDING_LIBGUILE]: Use the same-named function (lower-case). * libguile/stackchk.h (SCM_STACK_OVERFLOW_P): Conditionalize on `BUILDING_LIBGUILE'. * libguile/threads.h (SCM_I_CURRENT_THREAD, scm_i_dynwinds, scm_i_set_dynwinds, scm_i_last_debug_frame, scm_i_set_last_debug_frame): Conditionalize on `BUILDING_LIBGUILE'.
2009-10-02Use `SCM_DEPRECATED' in declarations of deprecated functions/variables.Ludovic Courtès1-1/+3
* libguile/deprecated.c (SCM_BUILDING_DEPRECATED_CODE): New macro. * libguile/async.c (SCM_BUILDING_DEPRECATED_CODE): Likewise. * libguile/macros.c (SCM_BUILDING_DEPRECATED_CODE): Likewise. * libguile/async.h, libguile/deprecated.h, libguile/eval.h, libguile/gc.h, libguile/gc.h, libguile/macros.h, libguile/ports.h, libguile/srfi-4.h, libguile/strings.h: Change declarations of deprecated functions and variables to use `SCM_DEPRECATED' instead of `SCM_API'.
2009-08-18Merge branch 'master' into boehm-demers-weiser-gcLudovic Courtès1-7/+8
Conflicts: lib/Makefile.am libguile/Makefile.am libguile/frames.c libguile/gc-card.c libguile/gc-freelist.c libguile/gc-mark.c libguile/gc-segment.c libguile/gc_os_dep.c libguile/load.c libguile/macros.c libguile/objcodes.c libguile/programs.c libguile/strings.c libguile/vm.c m4/gnulib-cache.m4 m4/gnulib-comp.m4 m4/inline.m4
2009-06-17Change Guile license to LGPLv3+Neil Jerram1-6/+7
(Not quite finished, the following will be done tomorrow. module/srfi/*.scm module/rnrs/*.scm module/scripts/*.scm testsuite/*.scm guile-readline/* )
2009-05-20Fix `explicitely' typos, should be `explicitly'Neil Jerram1-1/+1
2008-12-14Merge branch 'master' into boehm-demers-weiser-gcLudovic Courtès1-4/+6
Conflicts: lib/Makefile.am libguile/struct.c libguile/threads.c m4/gnulib-cache.m4 m4/gnulib-comp.m4
2008-11-30Check the return value of libc's functions to make `_FORTIFY_SOURCE=2' work.Ludovic Courtès1-4/+6
This fixes bug #24009 reported by Martin Pitt. * libguile/threads.c (guilify_self_1): Check the return value of pipe(2). (scm_std_select): Use `full_read ()' instead of `read ()' when reading from WAKEUP_FD. * libguile/async.c (scm_i_queue_async_cell): Use `full_write ()' instead of write(2) when writing to SLEEP_FD. * libguile/fports.c (fport_flush): Likewise. * libguile/posix.c (getgroups): Use the return value of getgroups(2) as NGROUPS. (scm_nice): Get the return value of nice(2) to make glibc happy. * libguile/scmsigs.c (take_signal): Use `full_write ()' instead of write(2).
2008-09-13Merge branch 'master' into boehm-demers-weiser-gcLudovic Courtès1-1/+1
Conflicts: lib/Makefile.am libguile/gc-card.c libguile/gc-freelist.c libguile/gc-mark.c libguile/gc-segment.c libguile/gc.c libguile/gc.h libguile/gc_os_dep.c libguile/private-gc.h m4/.cvsignore m4/gnulib-cache.m4 m4/gnulib-comp.m4
2008-09-13Include <config.h> in all C files; use `#ifdef HAVE_CONFIG_H' rather than `#if'.Ludovic Courtès1-1/+1
2008-09-05Removed a lot of now-useless SMOB mark/free functions.Ludovic Courtes1-6/+0
* libguile/arbiters.c (scm_init_arbiters): Don't invoke `scm_set_smob_mark'. * libguile/async.c (async_gc_mark): Removed. (scm_init_async): Don't invoke `scm_set_smob_mark'. * libguile/coop-pthreads.c (thread_mark): Removed. (create_thread): Use `scm_gc_malloc' instead of `scm_malloc' when allocating `launch_data'. (mutex_mark): Removed. (scm_threads_init): Don't invoke `scm_set_smob_mark' and `scm_set_smob_free'. * libguile/debug.c (scm_init_debug): Don't invoke `scm_set_smob_mark'. * libguile/dynl.c (dynl_obj_mark): Removed. (scm_init_dynamic_linking): Don't invoke `scm_set_smob_mark'. * libguile/dynwind.c (winder_mark): Removed. (scm_init_dynwind): Don't invoke `scm_set_smob_mark'. * libguile/environments.c (environment_mark): Removed. (environment_free): Removed. (observer_mark): Removed. (core_environments_mark): Removed. (core_environments_finalize): Removed. (leaf_environment_mark): Removed. (leaf_environment_free): Removed. (leaf_environment_funcs): Don't refer to the above funcs. (eval_environment_mark): Removed. (eval_environment_free): Removed. (eval_environment_funcs): Don't refer to the above funcs. (import_environment_mark): Removed. (import_environment_free): Removed. (import_environment_funcs): Don't refer to the above funcs. (export_environment_mark): Removed. (export_environment_free): Removed. (export_environment_funcs): Don't refer to the above funcs. (scm_environments_prehistory): Don't invoke `scm_set_smob_mark' and `scm_set_smob_free'. * libguile/environments.h (scm_environment_funcs)[mark]: Removed. [free]: Removed. * libguile/eval.c (promise_mark): Removed. (promise_free): Removed. (scm_init_eval): Don't invoke `scm_set_smob_mark' and `scm_set_smob_free'. * libguile/fluids.c (fluid_free): Removed. (scm_fluids_prehistory): Don't invoke `scm_set_smob_mark' and `scm_set_smob_free'. * libguile/futures.c (future_mark): Removed. (scm_init_futures): Don't invoke `scm_set_smob_mark'. * libguile/hashtab.c (hashtable_free): Removed. (scm_hashtab_prehistory): Don't invoke `scm_set_smob_mark' and `scm_set_smob_free'. * libguile/hooks.c (scm_init_hooks): Don't invoke `scm_set_smob_mark'. * libguile/keywords.c (scm_init_keywords): Don't invoke `scm_set_smob_mark'. * libguile/macros.c (scm_init_macros): Don't invoke `scm_set_smob_mark'. * libguile/modules.c (scm_init_modules): Don't invoke `scm_set_smob_mark'. * libguile/print.c (scm_init_print): Don't invoke `scm_set_smob_mark'. * libguile/random.c (scm_i_copy_rstate): Use `scm_gc_malloc' instead of `scm_malloc'. (scm_c_make_rstate): Likewise. (rstate_free): Removed. (scm_init_random): Don't invoke `scm_set_smob_free'. * libguile/srcprop.c (srcprops_mark): Removed. (scm_init_srcprop): Don't invoke `srcprops_mark'. * libguile/srfi-14.c (charset_free): Removed. (scm_init_srfi_14): Don't invoke `scm_set_smob_free'. * libguile/srfi-4.c (uvec_mark): Removed. (uvec_free): Removed. (scm_init_srfi_4): Don't invoke `scm_set_smob_free' and `scm_set_smob_mark'. * libguile/threads.c (thread_mark): Removed. (fat_mutex_mark): Removed. (fat_cond_mark): Removed. (scm_init_threads): Dont invoke `scm_set_smob_mark' and `scm_set_smob_free'. * libguile/unif.c (bitvector_free): Removed. (array_mark): Removed. (array_free): Removed. (scm_init_unif): Don't invoke `scm_set_smob_free' and `scm_set_smob_mark'. git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-28
2006-04-17merge from 1.8 branchKevin Ryde1-1/+1
2006-01-29Renamed the "frames" that are related to dynamic-wind to "dynamicMarius Vollmer1-6/+6
contexts. Renamed all functions from scm_frame_ to scm_dynwind_. Updated documentation.
2005-05-23The FSF has a new address.Marius Vollmer1-1/+1
2005-03-02See ChangeLog from 2005-03-02.Marius Vollmer1-55/+146
2004-09-22*** empty log message ***Marius Vollmer1-3/+3
2004-07-06* deprecated.h, boolean.h (SCM_FALSEP, SCM_NFALSEP, SCM_BOOL,Marius Vollmer1-1/+1
SCM_NEGATE_BOOL, SCM_BOOLP): Deprecated by moving into "deprecated.h". Replaced all uses with scm_is_false, scm_is_true, scm_from_bool, and scm_is_bool, respectively.
2004-01-11(scm_frame_unwind, scm_frame_unwind_handler): Renamed and changed allMarius Vollmer1-4/+4
uses. (scm_frame_rewind, scm_frame_rewind_handler): Likewise.
2004-01-07Did the follwing renamings: scm_with_blocked_asyncs ->Marius Vollmer1-6/+6
scm_frame_block_asyncs, scm_with_unblocked_asyncs -> scm_frame_unblock_asyncs. Changed all uses.
2004-01-06dynwind.h (SCM_F_WIND_EXPLICITELY, SCM_F_WIND_EXPLICITLY): It'sMarius Vollmer1-4/+4
"explicitly" not "explicitely", damn. Changed all uses.
2004-01-04(scm_with_blocked_asyncs, scm_with_unblocked_asyncs): New.Marius Vollmer1-1/+19
2003-04-05Changed license terms to the plain LGPL thru-out.Marius Vollmer1-35/+11
2003-03-25* async.c: #include <config.h> if HAVE_CONFIG_H.Rob Browning1-0/+3
2002-12-10* async.c, error.h (scm_ints_disabled): Removed.Mikael Djurfeldt1-5/+0
* gc.c (scm_gc_for_newcell), init.c (scm_init_guile_1), root.c (scm_internal_cwdr), gdbint.c (SCM_BEGIN_FOREIGN_BLOCK, SCM_END_FOREIGN_BLOCK): Don't touch scm_ints_disabled. (old_ints): Removed. * __scm.h (SCM_DEFER_INTS, SCM_ALLOW_INTS): Define as a recursive critical section. (SCM_REDEFER_INTS, SCM_ALLOW_INTS): Define as SCM_DEFER_INTS and SCM_ALLOW_INTS.
2002-11-03* __scm.h (USE_THREADS, GUILE_ISELECT): Define whenMarius Vollmer1-4/+0
SCM_DEBUG_DEPRECATED. Removed their use thru-out Guile.
2002-10-27(scm_async_click): Reset pending_asyncs, handleMarius Vollmer1-30/+46
signal_asyncs. Don't set cdr of a non-signal async to #f. (scm_i_queue_async_cell): Do not check cdr of cell for #f, queue always. Set pending_asyncs. (scm_system_async_mark_for_thread): Check that thread has not exited. (scm_unmask_signals, decrease_block): Call scm_async_click after block_asyncs becomes zero.
2002-10-20(SCM_MAKE_VALIDATE_MSG): New. Use it instead of SCM_MAKE_VALIDATE inMarius Vollmer1-1/+1
lots of places to gove better error messages. Thanks to Bill Schottstaedt!
2002-10-19Auto docstring updates, including soft port enhancement.Neil Jerram1-3/+8
2002-10-19* async.h, async.c (scm_system_async): Fixed deprecation to workDirk Herrmann1-3/+7
correctly when deprecated features are excluded.
2002-10-16(scm_system_async_mark_for_thread): Validate thread argument.Marius Vollmer1-3/+6
2002-10-11* async.c (s_scm_system_async_mark_for_thread): Only callMarius Vollmer1-0/+4
scm_i_thread_root when USE_THREADS is defined. Use scm_root otherwise. * scmsigs.c (take_signal): Only call scm_i_thread_root when USE_THREADS is defined. Use scm_root otherwise. (scm_sigaction_for_thread): Ignore THREAD argument when USE_THREADS is not defined. Also, move THREAD argument defaulting out of HAVE_SIGACTION section, which was a bug.
2002-10-09* async.h (scm_call_with_blocked_asyncs,Marius Vollmer1-12/+89
scm_call_with_unblocked_asyncs, scm_c_call_with_blocked_asyncs, scm_c_call_with_unblocked_asyncs): New prototypes. (scm_mask_signals, scm_unmask_signals): Deprecated. (scm_mask_ints): Turned into a macro. * async.c (scm_mask_ints): Removed. (scm_run_asyncs): Do not set scm_mask_ints while running an async. this should not be necessary. (scm_async_click): Test block_asyncs instead of scm_mask_ints. (scm_mask_signals, scm_unmask_signals): Deprecated. Emit deprecation warning and check for errornous use. Set block_asyncs instead of scm_mask_ints. (increase_block, decrease_block, scm_call_with_blocked_asyncs, scm_call_with_unblocked_asyncs, scm_c_call_with_blocked_asyncs, scm_c_call_with_unblocked_asyncs): New.
2002-10-05* async.c (scm_async_click): Set the cdr of a executed handlerMarius Vollmer1-5/+18
cell to SCM_BOOL_F, not SCM_EOL. (scm_i_queue_async_cell): Queue the cell at the end of the list, and only if the handler procedure is not already present. (scm_system_async_mark_for_thread): Initialize cdr of handler cell with SCM_BOOL_F. * scmsigs.c (scm_sigaction_for_thread): Likewise.
2002-10-04Removed GUILE_OLD_ASYNC_CLICK code. Reorganized so that system asnycsMarius Vollmer1-273/+92
and user asyncs are separated. Reimplemented system asyncs to work per-thread.
2002-07-202002-07-20 Han-Wen <hanwen@cs.uu.nl>Han-Wen Nienhuys1-1/+1
* *.c: add space after commas everywhere. * *.c: use SCM_VECTOR_SET everywhere, where a vector is written. Document cases where SCM_WRITABLE_VELTS() is used. * vectors.h (SCM_VELTS): prepare for write barrier, and let SCM_VELTS() return a const pointer (SCM_VECTOR_SET): add macro. * autogen.sh (mscripts): find and check version number of autoconf. Complain if 2.53 is not found.
2002-03-14Retire inclusion guard macro SCM_MAGIC_SNARFER.Thien-Thi Nguyen1-2/+0
2002-01-22* First batch of libguile changes for Elisp support.Neil Jerram1-3/+4
* Fixed a few typos. * Minor rationalization of macros relating to source breakpoints.
2001-11-25(scm_system_async_mark_from_signal_handler): New.Marius Vollmer1-0/+5
2001-07-09Remove "face-lift" comment.Thien-Thi Nguyen1-2/+0