Commit eb90831ce8 added it to the wrong
makefile.
* module/Makefile.am (SOURCES): Add srfi/srfi-71.scm.
* module/srfi/Makefile.am: Remove. It's a leftover from the 2009 build
system rework in commit 3bb299b3f0.
This is a followup to <https://bugs.gnu.org/29704>.
* module/srfi/srfi-18.scm (thread-sleep!): When TIMEOUT is a number,
keep it as-is.
* test-suite/tests/srfi-18.test ("thread sleep with number"): Pass 0 as
the timeout.
("thread sleeps fractions of a second"): Pass 0.5 as the timeout.
Fixes <https://bugs.gnu.org/29704>.
Reported by David Beswick <dlbeswick@gmail.com>.
* module/srfi/srfi-18.scm (timeout->absolute-time): New procedure.
(mutex-lock!): Use it in 'thread:lock-mutex' call.
(mutex-unlock!): Use it.
* test-suite/tests/srfi-18.test ("mutex-lock! returns false on timeout")
("mutex-lock! returns true when lock obtained within timeout")
("recursive lock waits")
("mutex unlock is false when condition times out"): Adjust cases where
the 'timeout' parameter is a number so that it's a relative number.
Commit eb90831ce8 added it to the wrong
makefile.
* module/Makefile.am (SOURCES): Add srfi/srfi-71.scm.
* module/srfi/Makefile.am: Remove. It's a leftover from the 2009 build
system rework in commit 3bb299b3f0.
This is a followup to <https://bugs.gnu.org/29704>.
* module/srfi/srfi-18.scm (thread-sleep!): When TIMEOUT is a number,
keep it as-is.
* test-suite/tests/srfi-18.test ("thread sleep with number"): Pass 0 as
the timeout.
("thread sleeps fractions of a second"): Pass 0.5 as the timeout.
Fixes <https://bugs.gnu.org/29704>.
Reported by David Beswick <dlbeswick@gmail.com>.
* module/srfi/srfi-18.scm (timeout->absolute-time): New procedure.
(mutex-lock!): Use it in 'thread:lock-mutex' call.
(mutex-unlock!): Use it.
* test-suite/tests/srfi-18.test ("mutex-lock! returns false on timeout")
("mutex-lock! returns true when lock obtained within timeout")
("recursive lock waits")
("mutex unlock is false when condition times out"): Adjust cases where
the 'timeout' parameter is a number so that it's a relative number.
* libguile/struct.h (SCM_VTABLE_BASE_LAYOUT): Layout is a "pr" field.
* module/ice-9/boot-9.scm (record-type-vtable): Record vtable fields are
writable.
(<parameter>): "pw" fields.
* module/oop/goops.scm (<class>, %compute-layout): <read-only> fields
are "pw" underneath.
* module/rnrs/records/procedural.scm (record-type-vtable)
(record-constructor-vtable, make-record-type-descriptor): Use "pw"
fields in vtables.
* module/srfi/srfi-35.scm (%condition-type-vtable)
(struct-layout-for-condition): "pw" fields in vtables.
* test-suite/tests/goops.test:
* test-suite/tests/structs.test: Use "pw" fields only.
* benchmark-suite/benchmarks/structs.bm: Update for make-struct/no-tail,
to use pw fields, and also to remove useless tests that the compiler
would optimize away.
* doc/ref/api-data.texi (Vtables): Add a note about the now-vestigial
permissions character and update documentation.
(Structure Basics, Meta-Vtables): Update examples.
* libguile/hash.c (scm_i_struct_hash): Remove code that would handle
opaque/self fields.
* libguile/print.h (SCM_PRINT_STATE_LAYOUT): Use "pw" fields.
* libguile/struct.c (scm_struct_init): Simplify check for hidden
fields.
* libguile/values.c (scm_init_values): Field is "pw".
* libguile/struct.h (SCM_VTABLE_BASE_LAYOUT, scm_vtable_index_self):
Remove "self" field. Renumber the other fields.
* module/oop/goops.scm (<self-slot>): Remove.
(fold-class-slots): Adapt for "self" slot removal. Adapt all users.
(class-redefinition): Now that there is no "self" slot to update, use
%modify-instance instead of %modify-class.
* libguile/goops.c (class_self): Remove.
(scm_sys_modify_class): Remove.
* libguile/goops.h (scm_sys_modify_class): Remove.
* module/rnrs/records/procedural.scm: Import vtable-offset-user.
Renumber rtd indexes using vtable-offset-user.
* module/srfi/srfi-35.scm (%condition-type-vtable): Remove mention of
vtable fields.
* module/system/base/types.scm (address->inferior-struct): Adapt for
different vtable field layout.
Fixes <http://bugs.gnu.org/26261>.
Reported by Zefram <zefram@fysh.org>.
* module/srfi/srfi-19.scm ("define directives"): N padding increased from 7 to 9
* test-suite/tests/srfi-19.test ("date->string"): New test.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.