summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ice-9/ChangeLog7
-rw-r--r--ice-9/threads.scm8
2 files changed, 14 insertions, 1 deletions
diff --git a/ice-9/ChangeLog b/ice-9/ChangeLog
index bca320e72..456603177 100644
--- a/ice-9/ChangeLog
+++ b/ice-9/ChangeLog
@@ -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.
diff --git a/ice-9/threads.scm b/ice-9/threads.scm
index c552a8596..f5d178a4e 100644
--- a/ice-9/threads.scm
+++ b/ice-9/threads.scm
@@ -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))