From b9b72a6efa717d5cfadfe9000df3ab1c867397d2 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Sat, 29 May 2010 01:49:40 -0400 Subject: [PATCH] ui.backend.cocoa: factor out stop-io-thread word for use by upcoming Gtk UI backend --- basis/io/thread/thread.factor | 3 +++ basis/ui/backend/cocoa/cocoa.factor | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/basis/io/thread/thread.factor b/basis/io/thread/thread.factor index 994dcd9c50..519dec3567 100644 --- a/basis/io/thread/thread.factor +++ b/basis/io/thread/thread.factor @@ -14,6 +14,9 @@ SYMBOL: io-thread-running? [ [ io-thread-running? get-global ] [ io-thread ] while ] "I/O wait" spawn drop ; +: stop-io-thread ( -- ) + f io-thread-running? set-global ; + [ t io-thread-running? set-global start-io-thread diff --git a/basis/ui/backend/cocoa/cocoa.factor b/basis/ui/backend/cocoa/cocoa.factor index 72a9abcef0..7982458bb4 100644 --- a/basis/ui/backend/cocoa/cocoa.factor +++ b/basis/ui/backend/cocoa/cocoa.factor @@ -252,7 +252,7 @@ M: cocoa-ui-backend (with-ui) init-clipboard cocoa-startup-hook get call( -- ) start-ui - f io-thread-running? set-global + stop-io-thread init-thread-timer reset-run-loop NSApp -> run