]> gitweb.factorcode.org Git - factor.git/commitdiff
concurrency.mailboxes: use unless-disposed.
authorJohn Benediktsson <mrjbq7@gmail.com>
Sat, 20 Jan 2018 20:23:32 +0000 (12:23 -0800)
committerJohn Benediktsson <mrjbq7@gmail.com>
Sat, 20 Jan 2018 20:23:32 +0000 (12:23 -0800)
basis/concurrency/mailboxes/mailboxes.factor

index 3e9a56b56cb17ee5675d431d7c1f2ed48c61be55..ff0032c6c57cb9b05adf24bb2e7e5ed835572e77 100755 (executable)
@@ -1,7 +1,8 @@
 ! Copyright (C) 2005, 2010 Chris Double, Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors concurrency.conditions continuations deques
-dlists fry kernel locals sequences threads vocabs.loader ;
+destructors dlists fry kernel locals sequences threads
+vocabs.loader ;
 IN: concurrency.mailboxes
 
 TUPLE: mailbox { threads dlist } { data dlist } ;
@@ -64,8 +65,9 @@ M: mailbox mailbox-get-timeout block-if-empty data>> pop-back ;
     f swap mailbox-get-timeout? ; inline
 
 : wait-for-close-timeout ( mailbox timeout -- )
-    over disposed>>
-    [ 2drop ] [ 2dup wait-for-mailbox wait-for-close-timeout ] if ;
+    '[
+        _ 2dup wait-for-mailbox wait-for-close-timeout
+    ] unless-disposed ;
 
 : wait-for-close ( mailbox -- )
     f wait-for-close-timeout ;