]> gitweb.factorcode.org Git - factor.git/blobdiff - basis/io/servers/servers.factor
factor: trim using lists
[factor.git] / basis / io / servers / servers.factor
old mode 100755 (executable)
new mode 100644 (file)
index 55b364b..8aa2f7f
@@ -1,12 +1,10 @@
 ! Copyright (C) 2003, 2010 Slava Pestov, Doug Coleman.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors arrays calendar combinators
-combinators.short-circuit concurrency.combinators
-concurrency.count-downs concurrency.flags
-concurrency.semaphores continuations debugger destructors fry
-io io.sockets io.sockets.secure io.streams.duplex io.styles
-io.timeouts kernel logging make math math.parser namespaces
-present prettyprint random sequences sets strings threads ;
+USING: accessors arrays calendar concurrency.flags
+concurrency.semaphores continuations destructors io io.sockets
+io.sockets.secure io.streams.duplex io.styles io.timeouts kernel
+logging make math namespaces present prettyprint random
+sequences sets strings threads ;
 IN: io.servers
 
 TUPLE: threaded-server < identity-tuple
@@ -34,10 +32,10 @@ ERROR: server-already-running threaded-server ;
 <PRIVATE
 
 : add-running-server ( threaded-server running-servers -- )
-    2dup in? [ server-already-running ] [ adjoin ] if ;
+    dupd ?adjoin [ drop ] [ server-already-running ] if ;
 
 : remove-running-server ( threaded-server running-servers -- )
-    2dup in? [ delete ] [ drop server-not-running ] if ;
+    dupd ?delete [ drop ] [ server-not-running ] if ;
 
 PRIVATE>
 
@@ -211,7 +209,7 @@ PRIVATE>
     '[
         [ _ threaded-server _ with-variable ]
         [ _ stop-server ]
-        [ ] cleanup
+        finally
     ] call ; inline
 
 <PRIVATE