1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-30 00:40:20 +02:00

* threads.scm (letpar): New macro.

This commit is contained in:
Mikael Djurfeldt 2002-12-09 12:58:52 +00:00
parent 9e6e154e84
commit fc85d09560
2 changed files with 14 additions and 1 deletions

View file

@ -1,3 +1,7 @@
2002-12-09 Mikael Djurfeldt <djurfeldt@nada.kth.se>
* threads.scm (letpar): New macro.
2002-12-08 Rob Browning <rlb@defaultvalue.org>
* debugger/breakpoints/Makefile.am (subpkgdatadir): VERSION ->
@ -10,7 +14,8 @@
2002-12-04 Mikael Djurfeldt <mdj@linnaeus>
* threads.scm (par-map, par-for-each, parallel):
* threads.scm (parallel): New macro.
(par-map, par-for-each): New procedures.
* documentation.scm (object-documentation): Added support for
defmacros.

View file

@ -63,6 +63,7 @@
:export-syntax (make-thread
begin-thread
parallel
letpar
with-mutex
monitor))
@ -188,6 +189,13 @@
(wait-condition-variable ,c ,m)
(values ,@vars))))))
(defmacro letpar (bindings . body)
`(call-with-values
(lambda ()
(parallel ,@(map cadr bindings)))
(lambda ,(map car bindings)
,@body)))
(defmacro with-mutex (m . body)
`(dynamic-wind
(lambda () (lock-mutex ,m))