]> gitweb.factorcode.org Git - factor.git/blobdiff - basis/concurrency/exchangers/exchangers.factor
threads: simplify 'suspend' combinator
[factor.git] / basis / concurrency / exchangers / exchangers.factor
index 97b3c14fe41cd29c4ac1185119b10463fcece045..7cfe01608529082aa7055e4b9c81ae7749697dfe 100644 (file)
@@ -1,4 +1,4 @@
-! Copyright (C) 2008 Slava Pestov.\r
+! Copyright (C) 2008, 2010 Slava Pestov.\r
 ! See http://factorcode.org/license.txt for BSD license.\r
 USING: kernel threads boxes accessors fry ;\r
 IN: concurrency.exchangers\r
@@ -17,5 +17,6 @@ TUPLE: exchanger thread object ;
         [ thread>> box> resume-with ] dip\r
     ] [\r
         [ object>> >box ] keep\r
-        '[ _ thread>> >box ] "exchange" suspend\r
+        [ self ] dip thread>> >box\r
+        "exchange" suspend\r
     ] if ;\r