]> gitweb.factorcode.org Git - factor.git/commitdiff
timers: simplify stop-timer.
authorJohn Benediktsson <mrjbq7@gmail.com>
Fri, 24 Aug 2018 03:37:20 +0000 (20:37 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Fri, 24 Aug 2018 03:37:20 +0000 (20:37 -0700)
basis/timers/timers.factor

index 925fc246a7b01fba39b4c90ec2fd75cb04aee720..029f640616c19bb149bb3de9664a894a9123787c 100644 (file)
@@ -88,10 +88,8 @@ PRIVATE>
 
 : stop-timer ( timer -- )
     dup quotation-running?>> [
-        f >>thread drop
-    ] [
-        [ [ interrupt ] when* f ] change-thread drop
-    ] if ;
+        dup thread>> [ interrupt ] when*
+    ] unless f >>thread drop ;
 
 : restart-timer ( timer -- )
     dup quotation-running?>> [