]> gitweb.factorcode.org Git - factor.git/commitdiff
Forgot to invoke callback
authorSlava Pestov <slava@oberon.internal.stack-effects.com>
Tue, 12 Feb 2008 18:19:25 +0000 (12:19 -0600)
committerSlava Pestov <slava@oberon.internal.stack-effects.com>
Tue, 12 Feb 2008 18:19:25 +0000 (12:19 -0600)
extra/io/unix/macosx/macosx.factor
extra/vocabs/monitor/monitor.factor

index 136035991c824f05b87b1be3d0f0c4ea9014bbb0..bd48fbc9b5684249b64849206538d321263ebb0b 100644 (file)
@@ -12,9 +12,9 @@ T{ macosx-io } set-io-backend
 TUPLE: macosx-monitor ;
 
 : enqueue-notifications ( triples monitor -- )
-    monitor-queue [
-        [ first { +modify-file+ } swap changed-file ] each
-    ] bind ;
+    tuck monitor-queue
+    [ [ first { +modify-file+ } swap changed-file ] each ] bind
+    notify-callback ;
 
 M: macosx-io <monitor>
     drop
@@ -25,4 +25,3 @@ M: macosx-io <monitor>
 
 M: macosx-monitor dispose
     dup simple-monitor-handle dispose delegate dispose ;
-
index 24aa8b1d99c4c78eace412d975983ebc9aa8cc60..e5b9a8c3a1a69c76c1b893b04a438c51f5b32172 100755 (executable)
@@ -1,4 +1,5 @@
-USING: threads io.files io.monitors init kernel tools.browser ;\r
+USING: threads io.files io.monitors init kernel tools.browser\r
+continuations ;\r
 IN: vocabs.monitor\r
 \r
 ! Use file system change monitoring to flush the tags/authors\r
@@ -7,8 +8,11 @@ IN: vocabs.monitor
     dup next-change 2drop reset-cache update-thread ;\r
 \r
 : start-update-thread\r
+    #! Silently ignore errors during monitor creation since\r
+    #! monitors are not supported on all platforms.\r
     [\r
-        "" resource-path t <monitor> update-thread\r
+        [ "" resource-path t <monitor> ] [ drop f ] recover\r
+        [ update-thread ] when*\r
     ] in-thread ;\r
 \r
 [ start-update-thread ] "tools.browser" add-init-hook\r