]> gitweb.factorcode.org Git - factor.git/commitdiff
unix.signals: tweak dispatch-signal-hooks.
authorJohn Benediktsson <mrjbq7@gmail.com>
Mon, 8 Mar 2021 23:46:24 +0000 (15:46 -0800)
committerJohn Benediktsson <mrjbq7@gmail.com>
Mon, 8 Mar 2021 23:46:24 +0000 (15:46 -0800)
basis/io/backend/unix/unix.factor
basis/unix/signals/signals-tests.factor
basis/unix/signals/signals.factor

index a081a063d9c13047e9f285e4c1dd8fa8999ec66f..d42dc575677298118ed85d330174c45fa3061653 100644 (file)
@@ -186,7 +186,7 @@ M: stdin cancel-operation
 : signal-pipe-loop ( port -- )
     '[
         int heap-size _ io:stream-read
-        dup [ int deref dispatch-signal-hook get call( x -- ) ] when*
+        dup [ int deref dispatch-signal-hook get-global call( x -- ) ] when*
     ] loop ;
 
 : start-signal-pipe-thread ( -- )
index e082d4b6b1dc67aa6c4b3d62585b1f7c93c13489..6b157a1cabcc0d91c1540e21603f0358d1a32faf 100644 (file)
@@ -17,7 +17,7 @@ test-sigusr1-handler SIGUSR1 add-signal-handler
 
     [ 1 ] [
         sigusr1-count get-global
-        SIGUSR1 raise drop
+        SIGUSR1 raise yield drop
         1.0 seconds sleep
         sigusr1-count get-global
         swap -
@@ -27,7 +27,7 @@ test-sigusr1-handler SIGUSR1 add-signal-handler
 
 { 0 } [
     sigusr1-count get-global
-    SIGUSR1 raise drop
+    SIGUSR1 raise yield drop
     1.0 seconds sleep
     sigusr1-count get-global swap -
 ] unit-test
index 672fb5cb7753428627918d75b8d9e0714e970fbe..60d21c75cde00420fc7d81e4484373813d32b4dc 100644 (file)
@@ -25,10 +25,6 @@ M: integer signal-name 1 - signal-names ?nth ;
 : signal-name. ( n -- )
     signal-name [ " (" ")" surround write ] when* ;
 
-SYMBOL: dispatch-signal-hook
-
-dispatch-signal-hook [ [ drop ] ] initialize
-
 <PRIVATE
 
 SYMBOL: signal-handlers
@@ -46,4 +42,6 @@ PRIVATE>
 : remove-signal-handler ( handler sig -- )
     signal-handlers get-global at [ remove-eq! ] when* drop ;
 
+SYMBOL: dispatch-signal-hook
+
 [ dispatch-signal ] dispatch-signal-hook set-global