summaryrefslogtreecommitdiff
path: root/libguile/async.h
AgeCommit message (Collapse)AuthorFilesLines
2013-11-28Merge commit '8571dbde639e0ee9885bad49c9e180474bd23646'Andy Wingo1-0/+16
Conflicts: libguile/procprop.c
2013-11-23Add mutex locking functions that also block asyncs.Mark H Weaver1-0/+16
* libguile/async.h (scm_i_pthread_mutex_lock_block_asyncs, scm_i_pthread_mutex_unlock_unblock_asyncs): New macros. * libguile/threads.c (do_unlock_with_asyncs): New static helper. (scm_i_dynwind_pthread_mutex_lock_block_asyncs): New function. * libguile/threads.h (scm_i_dynwind_pthread_mutex_lock_block_asyncs): Add prototype.
2011-05-15rename scm_async_click() to scm_async_tick(); privatize SCM_ASYNC_TICKAndy Wingo1-2/+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-12remove all deprecated codeAndy Wingo1-9/+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.
2009-10-09Arrange so that `SCM_I_CURRENT_THREAD' is not accessed outside of libguile.Ludovic Courtès1-11/+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-09Deprecate `scm_mask_ints'.Ludovic Courtès1-4/+0
* libguile/async.h (scm_mask_ints): Remove. * libguile/deprecated.c (scm_i_mask_ints): New. * libguile/deprecated.h (scm_mask_ints): New macro. (scm_i_mask_ints): New declaration.
2009-10-02Use `SCM_DEPRECATED' in declarations of deprecated functions/variables.Ludovic Courtès1-4/+4
* 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-09-30Fix spurious `throw from within critical section' errorsNeil Jerram1-5/+3
The crux of this problem was that the thread doing a throw, and so checking scm_i_critical_section_level, was different from the thread that was in a critical section. * libguile/async.h (scm_i_critical_section_level): Removed, replaced by per-thread critical_section_level. (SCM_CRITICAL_SECTION_START, SCM_CRITICAL_SECTION_END): Use per-thread critical_section_level. * libguile/continuations.c (scm_dynthrow): Check per-thread critical_section_level. * libguile/threads.c (guilify_self_1): Init per-thread critical_section_level. (scm_i_critical_section_level): Removed. * libguile/threads.h (scm_i_thread): New critical_section_level field. * libguile/throw.c (scm_ithrow): Check per-thread critical_section_level.
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/* )
2008-05-31Add `SCM_INTERNAL' macro, use it.Ludovic Courtès1-6/+7
2006-04-17merge from 1.8 branchKevin Ryde1-1/+1
2006-01-29Renamed the "frames" that are related to dynamic-wind to "dynamicMarius Vollmer1-2/+2
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-24* async.h (scm_mask_ints): Removed left over reference toMikael Djurfeldt1-2/+2
scm_root. * threads.c: Removed fprintf debug statements.
2005-03-07* threads.h, async.h, threads.c (SCM_CRITICAL_SECTION_START,Marius Vollmer1-0/+26
SCM_CRITICAL_SECTION_END): Moved here from threads.h since now they also block/unblock execution of asyncs and call scm_async_click which is declared in async.h but threads.h can not include async.h since async.h already includes threads.h. (scm_i_critical_section_level): New, for checking mistakes in the use of the SCM_CRITICAL_SECTION_* macros. (scm_i_critical_section_mutex): Make it a recursive mutex so that critical sections can be nested. * threads.h, threads.c (scm_frame_lock_mutex): New. (scm_frame_critical_section): Take mutex as argument. (framed_critical_section_mutex): New, used as default for above. (scm_init_threads): Initialize it. (scm_threads_prehistory): Do not initialize thread_admin_mutex and scm_i_critical_section_mutex; both are initialized statically.
2005-03-02See ChangeLog from 2005-03-02.Marius Vollmer1-1/+6
2004-01-07Did the follwing renamings: scm_with_blocked_asyncs ->Marius Vollmer1-2/+2
scm_frame_block_asyncs, scm_with_unblocked_asyncs -> scm_frame_unblock_asyncs. Changed all uses.
2004-01-04(scm_with_blocked_asyncs, scm_with_unblocked_asyncs): New.Marius Vollmer1-1/+3
2003-04-05Changed license terms to the plain LGPL thru-out.Marius Vollmer1-35/+11
2002-10-19* async.h, async.c (scm_system_async): Fixed deprecation to workDirk Herrmann1-1/+1
correctly when deprecated features are excluded.
2002-10-13* evalext.h: Replaced SCM_DEBUG_DEPRECATED with !SCM_ENABLE_DEPRECATED.Dirk Herrmann1-1/+1
2002-10-09* async.h (scm_call_with_blocked_asyncs,Marius Vollmer1-2/+11
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-04* async.h (scm_asyncs_pending, scm_set_tick_rate,Marius Vollmer1-4/+2
scm_set_switch_rate, scm_system_async_mark_from_signal_handler): Removed prototypes. (scm_i_queue_async_cell): New.
2002-10-03(scm_system_async_mark_for_thread): New prototype.Marius Vollmer1-1/+2
2001-11-25(scm_system_async_mark_from_signal_handler): New.Marius Vollmer1-0/+1
2001-11-02Prefixed each each exported symbol with SCM_API.Marius Vollmer1-15/+15
2001-08-31* Renamed header macros to the SCM_<filename>_H format.Dirk Herrmann1-1/+2
2001-07-19 * alist.c, arbiters.c, async.h, backtrace.h, boolean.c, chars.c,Martin Grabmüller1-1/+1
chars.h, continuations.h, debug-malloc.h, dynl.c, feature.c, feature.h, filesys.h, fluids.h, fports.h, gc_os_dep.c, gdb_interface.h, gh_eval.c, gh_funcs.c, gh_io.c, gh_list.c, gh_predicates.c, gsubr.c, gsubr.h, guardians.h, guile-func-name-check.in, guile-snarf-docs-texi.in, guile-snarf-docs.in, guile-snarf.awk.in, guile-snarf.in, hashtab.h, iselect.h, keywords.h, lang.c, list.h, load.h, objprop.c, objprop.h, options.c, options.h, random.h, regex-posix.h, root.c, root.h, script.c, snarf.h, stackchk.c, strerror.c, strop.h, strports.h, threads.h, values.c, values.h, version.c, version.h: Updated copyright notice.
2001-07-09Remove "face-lift" comment.Thien-Thi Nguyen1-2/+0
2001-06-26Make compilation under Windows easier.Martin Grabmüller1-3/+3
2000-06-28* Cleaned up initialization of asyncs.Dirk Herrmann1-2/+1
* Moved handling of scm_gc_async to gc.c. * Extracted handling of scheme level after-gc-hook from gc core.
2000-04-05* async.[ch]: unexpose low-level async access macros (thanks toMichael Livshin1-7/+0
Dirk Herrmann). * validate.h: move async validation macros to async.c (nobody else needs them anyway), and rename them.
2000-04-04* async.h: kill the scm_async_t struct. having a heap cellMichael Livshin1-9/+6
pretending to be a C struct is not helthy, and is not needed here anyway, as asyncs happily fit in one heap cell. * async.c: reflect the fact that asyncs are now represented by single heap cell each.
2000-03-19 * *.[hc]: add Emacs magic at the end of file, to ensure GNUMichael Livshin1-0/+6
indentation style.
2000-03-14* async.c, async.h: made async representation a double cell.Mikael Djurfeldt1-3/+3
2000-03-02* list.c: Moved append docs to append! Thanks Dirk Hermann. Also,Greg J. Badros1-14/+14
added append docs from R4RS. * strings.c: Docstring typo fix, + eliminate unneeded IMP tests. Thanks Dirk Hermann! * chars.h: Provide SCM_CHARP, SCM_CHAR, SCM_MAKE_CHAR and deprecate SCM_ICHRP, SCM_ICHR, SCM_MAKICHR. Thanks Dirk Hermann! * *.h, *.c: Use SCM_CHARP, SCM_CHAR, SCM_MAKE_CHAR throughout. Drop use of SCM_P for function prototypes... assume an ANSI C compiler. Thanks Dirk Hermann!
1999-12-16* *.h: Use SCM_NIMP(X) && in all the FOOP macros.Greg J. Badros1-1/+4
* *.[ch]: Use do { ... } while (0) idiom in macros that expanded to a bare block.
1998-10-19* __scm.h, alist.c, async.c, async.h, backtrace.h, chars.c,Jim Blandy1-1/+1
continuations.c, debug.c, debug.h, dynl-dl.c, dynl.c, dynl.h, dynwind.c, dynwind.h, eq.c, error.c, error.h, eval.c, eval.h, feature.c, filesys.c, filesys.h, fports.c, fports.h, gc.c, gc.h, genio.c, genio.h, gh.h, gh_data.c, gsubr.c, gsubr.h, hash.c, hashtab.c, init.c, init.h, ioext.c, ioext.h, kw.c, libguile.h, list.c, list.h, load.c, load.h, mallocs.c, markers.c, mit-pthreads.c, net_db.c, numbers.c, numbers.h, options.c, ports.c, ports.h, posix.c, posix.h, print.c, print.h, procprop.c, procprop.h, procs.c, procs.h, ramap.c, ramap.h, regex-posix.c, regex-posix.h, root.c, root.h, scmsigs.c, scmsigs.h, script.c, script.h, simpos.c, simpos.h, smob.c, smob.h, snarf.h, socket.c, srcprop.c, stackchk.c, stackchk.h, stacks.c, stime.c, stime.h, strings.c, strings.h, strports.c, struct.c, struct.h, symbols.c, symbols.h, tags.h, threads.c, throw.h, unif.c, variable.c, vectors.c, vectors.h, version.h, vports.c, weaks.c: Update copyright years.
1998-01-30* async.c, async.h (asyncs_pending): Renamed asyncs_pending -->Mikael Djurfeldt1-0/+1
scm_asyncs_pending and made it global.
1997-05-31* scmsigs.h, async.h: updated.Gary Houston1-2/+11
* _scm.h: if HAVE_RESTARTS is defined then don't use a SYSCALL loop. * posix.c (scm_uname): interpret only negative values as an error. Solaris normally returns a positive value. * script.c (scm_compile_shell_switches): if we are not going into an interactive repl, set scm_mask_ints to zero so that asyncs can run. * simpos.c (scm_system): don't ignore/unignore signals around the "system" call. * posix.c (scm_open_pipe): don't ignore/unignore signals around the "popen" call. * init.c (scm_boot_guile_1): don't call scm_init_signals, it's done in boot-9.scm instead. * scmsigs.c, async.c: Major rewriting of signal handling code. (scm_sigaction): new procedure. (scm_sleep): don't wrap sleep in SCM_SYSCALL, it would mess up the timing. (scm_raise): return unspecified, throw error on failure. * boot-9.scm: signal-handler, alarm-thunk: removed. don't define ticks-interrupt etc. top-repl: install signal handlers for SIGINT, SIGFPE, SIGSEGV, SIGBUS during call to scm-style-repl. * acconfig.h: mention HAVE_RESTARTS. * configure.in: check for sigaction and restartable system calls.
1997-05-26* Lots of files: New address for FSF.Jim Blandy1-3/+3
1997-04-29 * async.c (scm_sys_tick_async_thunk): commented out. I'm notGary Houston1-1/+1
sure how this was supposed to work. (scm_async_click): don't send SCM_TICK_SIGNAL. (scm_init_async): don't initialize %tick-thunk. * the following change doesn't affect the Scheme interface: gc-thunk is called at the end of garbage collection. however it's no longer implemented by pretending it's a signal. * gc.c (scm_gc_end): don't call scm_take_signal. instead mark the system async corresponding to scm_gc_thunk. * async.h: declare scm_gc_async. * async.c (scm_sys_gc_async_thunk): apply the thunk named by gc-thunk directly, instead of going through a signal handler. (scm_gc_async): new variable, points to the GC system-async. (scm_init_async): save the GC async as scm_gc_async instead of using system_signal_asyncs. (scm_gc_vcell): new variable, stores the gc-thunk vcell.
1996-10-14* __scm.h, alist.c, alist.h, append.c, append.h, appinit.c,Jim Blandy1-33/+14
arbiters.c, arbiters.h, async.c, async.h, boolean.c, boolean.h, chars.c, chars.h, continuations.c, continuations.h, debug.c, debug.h, dynwind.c, dynwind.h, eq.c, eq.h, error.c, eval.c, eval.h, extchrs.c, extchrs.h, fdsocket.c, fdsocket.h, filesys.c, filesys.h, fports.c, fports.h, gc.c, gdb_interface.h, gdbint.c, gdbint.h, genio.c, genio.h, gscm.c, gscm.h, gsubr.c, gsubr.h, hash.c, hash.h, hashtab.c, hashtab.h, init.c, ioext.c, ioext.h, kw.c, kw.h, libguile.h, mallocs.c, mallocs.h, markers.c, markers.h, mbstrings.c, mbstrings.h, numbers.c, numbers.h, objprop.c, objprop.h, options.c, options.h, pairs.c, pairs.h, ports.c, ports.h, posix.c, posix.h, print.c, print.h, procprop.c, procprop.h, procs.c, procs.h, ramap.c, ramap.h, read.c, read.h, root.c, scmsigs.c, scmsigs.h, sequences.c, sequences.h, simpos.c, simpos.h, smob.c, socket.c, socket.h, srcprop.c, srcprop.h, stackchk.c, stackchk.h, stime.c, stime.h, strings.c, strings.h, strop.c, strop.h, strorder.c, strorder.h, strports.c, strports.h, struct.c, struct.h, symbols.c, symbols.h, tag.c, tag.h, unif.c, unif.h, variable.c, variable.h, vectors.c, vectors.h, version.c, version.h, vports.c, vports.h, weaks.c, weaks.h: Use SCM_P to declare functions with prototypes. (Patch thanks to Marius Vollmer.)
1996-09-11* async.h (scm_async_clock): Redundant declaration removed.Jim Blandy1-1/+0
1996-09-05* alist.h, append.h, arbiters.h, async.h, boolean.h, chars.h,Jim Blandy1-1/+1
continuations.h, debug.h, dynwind.h, error.h, eval.h, fdsocket.h, feature.h, filesys.h, fports.h, gc.h, gdbint.h, genio.h, gsubr.h, hash.h, init.h, ioext.h, kw.h, list.h, markers.h, marksweep.h, mbstrings.h, numbers.h, objprop.h, options.h, pairs.h, ports.h, posix.h, print.h, procprop.h, procs.h, ramap.h, read.h, root.h, sequences.h, smob.h, socket.h, srcprop.h, stackchk.h, stime.h, strings.h, strop.h, strorder.h, strports.h, struct.h, symbols.h, tag.h, throw.h, unif.h, variable.h, vectors.h, version.h, vports.h, weaks.h: #include "libguile/__scm.h", not <libguile/__scm.h>. This allows 'gcc -MM' to determine which dependencies are within libguile properly.
1996-09-04Don't install the unwashed masses of Guile header files in theJim Blandy1-1/+1
main #include path; put most of them in a subdirectory called 'libguile'. This avoids naming conflicts between Guile header files and system header files (of which there were a few). * Makefile.in (pkgincludedir): Deleted. (innerincludedir): New variable; this and $(includedir) are enough. (INCLUDE_CFLAGS): Search for headers in "-I$(srcdir)/..". (installed_h_files): Divide this up. Now this variable lists those header files which should go into $(includedir) (i.e. appear directly in the #include path), and ... (inner_h_files): ... this new variable says which files appear in a subdirectory, and are referred to as <libguile/mumble.h>. (h_files): List them both. (install): Create innerincludedir, not pkgincludedir. Put the installed_h_files and inner_h_files in their proper places. (uninstall): Corresponding changes. * alist.h, append.h, arbiters.h, async.h, boolean.h, chars.h, continuations.h, debug.h, dynwind.h, error.h, eval.h, fdsocket.h, feature.h, fports.h, gc.h, genio.h, gsubr.h, hash.h, init.h, ioext.h, kw.h, libguile.h, list.h, markers.h, marksweep.h, mbstrings.h, numbers.h, options.h, pairs.h, ports.h, posix.h, print.h, procprop.h, procs.h, ramap.h, read.h, root.h, sequences.h, smob.h, socket.h, srcprop.h, stackchk.h, stime.h, strings.h, strop.h, strorder.h, strports.h, struct.h, symbols.h, tag.h, throw.h, unif.h, variable.h, vectors.h, version.h, vports.h, weaks.h: Find __scm.h in its new location. * __scm.h: Find scmconfig.h and tags.h in their new locations (they're both "inner" files).
1996-07-25maintainer changed: was lord, now jimb; first importJim Blandy1-0/+91