summaryrefslogtreecommitdiff
path: root/module/srfi
Commit message (Expand)AuthorAgeFilesLines
* SRFI-18 mutexes are not recursive...* module/srfi/srfi-18.scm (make-mutex): Not recursive. Andy Wingo2016-11-051-8/+1
* Move more functionality to SRFI-18 mutex-unlock!...* module/srfi/srfi-18.scm (mutex-unlock!): Implement the ignore-unlock-errors and wait-condition-variable behavior of mutex-unlock! directly, without relying on Guile. Andy Wingo2016-11-051-15/+17
* SRFI-18 manages own mutex "abandoned" state...* module/srfi/srfi-18.scm (<mutex>, with-thread-mutex-cleanup) (make-mutex, mutex-state, abandon-mutex!, mutex-lock!): Manage "abandoned" bit on Scheme side with no need for thread cleanup handler. Andy Wingo2016-11-051-21/+20
* SRFI-18 threads disjoint from guile threads...* doc/ref/srfi-modules.texi (SRFI-18 Threads): Update. * module/srfi/srfi-18.scm (<mutex>): Add owner field. (<thread>): New data type. (make-thread): Adapt for boxed threads. (thread-start!, thread-terminate!): Likewise. (mutex-state): Adapt for boxed threads. (mutex-lock!, mutex-unlock!): Update owner field. Andy Wingo2016-11-041-67/+75
* srfi-18 condition variables disjoint...* module/srfi/srfi-18.scm (<condition-variable>): New data type. (make-thread): Use srfi-18 interfaces. (mutex-unlock!): Adapt to optional cond argument being disjoint from Guile condition variables. (make-condition-variable, condition-variable-signal!) (condition-variable-broadcast!): Adapt. Andy Wingo2016-11-041-32/+27
* Remove export srfi-18 never had...* module/srfi/srfi-18.scm (condition-variable-wait!): Remove undefined export. Andy Wingo2016-11-041-1/+0
* SRFI-18 mutexes disjoint from Guile mutexes...* module/srfi/srfi-18.scm (<mutex>): Define as a wrapper type around Guile mutexes. (thread-mutexes): New variable. (with-thread-mutex-cleanup): New facility to abandon mutexes on SRFI-18 thread exit. Not yet used. (make-thread): Use SRFI-18 interfaces. (make-mutex): Reimplement for our boxed mutexes. (mutex-state): Adapt. (mutex-lock!): Adapt. (mutex-unlock!): Adapt. * test-suite/tests/srfi-18.test: Don't assume that SRFI-18 mutexes are the same as Guile mutexes. Andy Wingo2016-11-041-41/+62
* srfi-18: thread-terminate! without cleanup handlers...* module/srfi/srfi-18.scm (%cancel-sentinel, thread-terminate!): Just use cancel-thread to cause the thread to return a sentinel value. (%timeout-sentinel): Rename from %sentinel. (thread-join!): Adapt and transform %cancel-sentinel to a &terminated-thread-exception. Andy Wingo2016-10-311-23/+13
* Trim srfi-18 thread startup machinery...* module/srfi/srfi-18.scm (make-thread): Use just one cond/mutex pair for signalling in both directions: waiting for launch and waiting for start. Andy Wingo2016-10-311-10/+6
* Refactor thread-join! to use optional args....* module/srfi/srfi-18.scm (thread-join!): Use optional args. Also don't treat false return values from threads as meaning anything. Andy Wingo2016-10-311-7/+14
* Rationalize exception handling in srfi-18...* module/srfi/srfi-18.scm (make-thread): Inline some helpers, and use just one catch block. (thread->exception): Move up definition. (exception-handler-for-foreign-threads): Use this as the default handler, not the one that squirrels away exceptions in thread->exception. (thread-terminate!): Don't instate an exception handler for the thread cleanup proc. Andy Wingo2016-10-311-44/+38
* srfi-18: Avoid call/cc....* module/srfi/srfi-18.scm (with-exception-handlers-here): New function. (wrap): Remove. (thread-join!, mutex-lock!): Use with-exception-handlers-here instead of the call/cc+wrap mess. Andy Wingo2016-10-311-29/+35
* srfi-18: Inline uses of srfi-18-exception-preserver....* module/srfi/srfi-18.scm (srfi-18-exception-preserver): Inline into call sites. Andy Wingo2016-10-301-16/+13
* srfi-18: Use srfi-35 conditions....* module/srfi/srfi-18.scm: Use srfi-35 conditions instead of our home-grown equivalent system. (thread-exception-handlers): Remove unused table. (srfi-18-exception-handler): Always capture key consed to args; no special case for bare key. * test-suite/tests/srfi-18.test (provided?): Adapt to reason always being key+args. Andy Wingo2016-10-301-26/+25
* srfi-18: Use parameters....* module/srfi/srfi-18.scm: Use srfi-34 internally with srfi-34: prefix. (current-exception-handler): Be a parameter. (with-exception-handler): Adapt to current-exception-handler change. (thread-join!, mutex-lock!): Adapt to use srfi-34: prefix. Andy Wingo2016-10-301-25/+15
* srfi-18: Use lambda* optional arguments....* module/srfi/srfi-18.scm (make-mutex, make-condition-variable): Use optional arguments. Andy Wingo2016-10-301-12/+10
* srfi-18: Simplify thread-sleep!, thread-terminate!....* module/srfi/srfi-18.scm (thread-sleep!): Use `when'. (thread-terminate!): Simplify. Andy Wingo2016-10-301-19/+15
* srfi-18: Use `match' in thread-start!....* module/srfi/srfi-18.scm (thread-start!): Use `match'. Andy Wingo2016-10-301-9/+10
* srfi-18: Improve style....* module/srfi/srfi-18.scm (raise): Rely on SRFI-34 to #:replace raise. (make-thread): Use lambda* and when. Andy Wingo2016-10-301-11/+7
* Fix srfi-34 indentation...* module/srfi/srfi-34.scm (with-exception-handler): Fix indentation. Andy Wingo2016-10-301-3/+3
* Move thread bindings to (ice-9 threads)...* libguile/init.c (scm_i_init_guile): Don't call scm_init_thread_procs. * libguile/threads.c (scm_init_ice_9_threads): Rename from scm_init_thread_procs, make static. (scm_init_threads): Register scm_init_thread_procs extension. * libguile/threads.h (scm_init_thread_procs): Remove decl. * module/ice-9/boot-9.scm: Load (ice-9 threads), so that related side effects occur early. * module/ice-9/deprecated.scm (define-deprecated): Fix to allow deprecated bindings to appear in operator position. Export deprecated bindings. (define-deprecated/threads, define-deprecated/threads*): Trampoline thread bindings to (ice-9 threads). * module/ice-9/futures.scm: Use ice-9 threads. * module/ice-9/threads.scm: Load scm_init_ice_9_threads extension. Reorder definitions and imports so that the module circularity with (ice-9 futures) continues to work. * module/language/cps/intmap.scm: * module/language/cps/intset.scm: * module/language/tree-il/primitives.scm: Use (ice-9 threads). * module/language/cps/reify-primitives.scm: Reify current-thread in (ice-9 threads) module. * module/srfi/srfi-18.scm: Use ice-9 threads with a module prefix, and adapt all users. Use proper keywords in module definition form. * test-suite/tests/filesys.test (test-suite): * test-suite/tests/fluids.test (test-suite): * test-suite/tests/srfi-18.test: Use ice-9 threads. * NEWS: Add entry. * doc/ref/api-scheduling.texi (Threads): Update. * doc/ref/posix.texi (Processes): Move current-processor-count and total-processor-count docs to Threads. Andy Wingo2016-10-231-111/+111
* SRFI-19: Update the table of leap seconds....* module/srfi/srfi-19.scm (leap-second-table): Update to include the most recent leap second. Mark H Weaver2016-05-221-3/+4
* Merge commit '8cf2a7ba7432d68b9a055d29f18117be70375af9'Andy Wingo2015-01-221-0/+34
|\
| * Implement SRFI 28: Basic Format Strings....* module/srfi/srfi-28.scm: New module. * module/Makefile.am (SRFI_SOURCES): Add srfi/srfi-28.scm. * doc/ref/srfi-modules.texi (SRFI-28): New node. Chris Jester-Young2014-12-021-0/+34
* | Merge branch 'stable-2.0'...Conflicts: benchmark-suite/benchmarks/ports.bm libguile/async.h libguile/bytevectors.c libguile/foreign.c libguile/gsubr.c libguile/srfi-1.c libguile/vm-engine.h libguile/vm-i-scheme.c module/Makefile.am module/language/tree-il/analyze.scm module/language/tree-il/peval.scm module/scripts/compile.scm module/scripts/disassemble.scm test-suite/tests/asm-to-bytecode.test test-suite/tests/peval.test test-suite/tests/rdelim.test Mark H Weaver2014-09-301-9/+9
|\|
| * doc: Improve description of vector-unfold and vector-unfold-right....* doc/ref/srfi-modules.texi (SRFI-43 Constructors)[vector-unfold]: Improve description. * module/srfi/srfi-43.scm (vector-unfold, vector-unfold-right): Improve docstrings. Mark H Weaver2014-09-241-8/+8
| * SRFI-43: vector-concatenate: Fix error message....* module/srfi/srfi-43.scm (vector-concatenate): Fix the 'who' of an error message. Mark H Weaver2014-09-201-1/+1
* | Rewrite boot-9 map to be recursive and pure...* module/ice-9/boot-9.scm (map): Rewrite to be recursive and pure instead of iterative and effectful. At best this is faster; at worst it is slower. In any case it resolves continuation-related issues. * module/srfi/srfi-1.scm (fold): Specialize the two-arg case. (map): Rewrite to be recursive. * test-suite/tests/r5rs_pitfall.test (8.3): Update for new expected map behavior. Andy Wingo2014-05-011-26/+46
* | Merge branch 'stable-2.0'...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 Mark H Weaver2014-04-252-7/+10
|\|
| * Calculate usecs correctly in thread-sleep!...* module/srfi/srfi-18.scm (thread-sleep!): Correctly compute microseconds. * test-suite/tests/srfi-18.test: Add test. Nathaniel Alderson2014-03-231-1/+1
| * SRFI-19: Update the table of leap seconds....* module/srfi/srfi-19.scm (leap-second-table): Update to include the two most recent leap seconds. Mark H Weaver2014-03-031-3/+6
| * SRFI-18: Export 'current-thread'....Fixes <http://debbugs.gnu.org/16890>. Reported by Xin Wang <dram.wang@gmail.com>. * module/srfi/srfi-18.scm: Reexport 'current-thread'. * THANKS: Add "Xin Wang" to fixes section. Mark H Weaver2014-02-271-3/+3
* | Match and srfi-9 expose their bailouts to the CSE pass...* module/ice-9/match.upstream.scm (match-next): Inline a call to "error", so the new CSE pass will see this case as a bailout. * module/srfi/srfi-9.scm (throw-bad-struct): Reimplement as a syntax rule, so that the CSE pass sees the "throw" call. Andy Wingo2014-04-051-6/+6
* | Optimize two-list srfi-1 map...* module/srfi/srfi-1.scm (map): Optimize the two-list variant. Andy Wingo2014-04-011-0/+17
* | Simplify boot-9 and srfi-1 map...* module/ice-9/boot-9.scm (map): * module/srfi/srfi-1.scm (map): Simplify the implementations to check for list? beforehand. It's faster, and it will be needed if we decide to go recursive. Andy Wingo2014-03-311-14/+5
* | Optimize srfi-1 for-each with two lists....* module/srfi/srfi-1.scm (for-each): Optimize for the two-list case. Andy Wingo2014-03-161-0/+16
* | More for-each micro-optimizations...* module/ice-9/boot-9.scm (for-each): * module/srfi/srfi-1.scm (for-each): Re-implement one-list case using an explicit check for list? instead of the tortoise-hare thing. Seems to be faster! Andy Wingo2014-03-161-17/+5
* | Port unrolled one-argument for-each from boot-9 to srfi-1...* module/srfi/srfi-1.scm (for-each): Port unrolled one-argument implementation here from the boot-9 version. Andy Wingo2014-03-021-11/+12
* | Merge commit '2f3b7e9a41677bfe802e8a1ee851827297384c58'...Conflicts: module/ice-9/pretty-print.scm Andy Wingo2014-02-082-59/+4
|\|
| * (srfi srfi-4 gnu) uses private define-bytevector-type from (srfi srfi-4)...* module/srfi/srfi-4/gnu.scm: Re-use implementation of define-bytevector-type from srfi-4. Andy Wingo2014-02-071-41/+4
| * Remove private unused duplicate c32/c64vector definitions...* module/srfi/srfi-4.scm: Remove vestigial definitions for c32vectors and c64vectors. Those are defined in (srfi srfi-4 gnu). Andy Wingo2014-02-071-18/+0
* | Merge commit 'a675a2e81b792b9f860bec57c38a1948631c7a41'Andy Wingo2014-02-081-6/+3
|\|
| * SRFI-4 predicates, length accessors only accept bytevectors (not arrays)...* module/srfi/srfi-4.scm (define-bytevector-type): For the predicates and length accessors, only accept bytevectors. Since arrays don't work for u32vector-ref et al, they shouldn't pass u32vector?. Andy Wingo2014-02-071-6/+3
* | Merge commit '34e89877342f20fdb8a531ad78dab34cfd2b0843'...Conflicts: module/Makefile.am Andy Wingo2014-02-073-0/+2172
|\|
| * Implement SRFI-64 - A Scheme API for test suites....* module/srfi/srfi-64.scm: New file. * module/srfi/srfi-64/testing.scm: New file. * module/Makefile.am: Add rule for srfi-64.go dependency on srfi-64/testing.scm. (SRFI_SOURCES): Add srfi/srfi-64.scm. (NOCOMP_SOURCES): Add srfi/srfi-64/testing.scm. * doc/ref/srfi-modules.texi (SRFI-64): New node. * test-suite/tests/srfi-64.test: New file. * test-suite/tests/srfi-64-test.scm: New file. * test-suite/Makefile.am (SCM_TESTS): Add test-suite/tests/srfi-64.test. (EXTRA_DIST): Add tests/srfi-64-test.scm. Mark H Weaver2014-02-012-0/+1095
| * Implement SRFI-43 Vector Library....* module/srfi/srfi-43.scm: New file. * module/Makefile.am (SRFI_SOURCES): Add module/srfi/srfi-43.scm. * test-suite/tests/srfi-43.test: New file. * test-suite/Makefile.am (SCM_TESTS): Add test-suite/tests/srfi-43.test. * doc/ref/srfi-modules.texi (SRFI-43, SRFI-43 Constructors) (SRFI-43 Predicates, SRFI-43 Selectors, SRFI-43 Iteration) (SRFI-43 Searching, SRFI-43 Mutators, SRFI-43 Conversion): New nodes. Mark H Weaver2014-02-011-0/+1077
* | Merge commit 'ca5e0414e96886177d883a249edd957d2331db65'...Conflicts: module/language/tree-il/primitives.scm Andy Wingo2014-02-071-0/+37
|\|
| * Implement SRFI-111 Boxes....* module/srfi/srfi-111.scm: New file. * module/Makefile.am (SRFI_SOURCES): Add srfi/srfi-111.scm. * test-suite/tests/srfi-111.test: New file. * test-suite/Makefile.am (SCM_TESTS): Add tests/srfi-111.test. * doc/ref/srfi-modules.texi (SRFI-111): New node. Mark H Weaver2014-01-241-0/+37
* | Merge commit 'f6ddf827f8f192af7a8cd255bd8374a0d38bbb74'...Conflicts: module/ice-9/boot-9.scm module/oop/goops.scm Andy Wingo2014-02-071-1/+1
|\|
| * Improve correctness and consistency of 'eval-when' usage....* module/ice-9/boot-9.scm: * module/ice-9/i18n.scm: * module/ice-9/poll.scm: * module/ice-9/popen.scm: * module/ice-9/r6rs-libraries.scm: * module/oop/goops.scm: * module/oop/goops/compile.scm: * module/oop/goops/dispatch.scm: * module/srfi/srfi-88.scm: * module/system/foreign.scm: * module/texinfo/serialize.scm: Change most uses of 'compile' to 'expand', except where we must avoid it during initial bootstrap before the module system is loaded. Remove redundant uses of 'compile' where 'expand' is also given. Standardize on the "(expand load eval)" order of conditions. Mark H Weaver2014-01-231-1/+1