From 2fad8cc734c924da7a08fb6ed900ab0f03aa47a3 Mon Sep 17 00:00:00 2001 From: "chris.double" Date: Wed, 26 Jul 2006 23:23:10 +0000 Subject: [PATCH] concurreny fix to set 'self' process in global namespace --- contrib/concurrency/concurrency.factor | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/contrib/concurrency/concurrency.factor b/contrib/concurrency/concurrency.factor index e2a227991f..96fd75d3e3 100644 --- a/contrib/concurrency/concurrency.factor +++ b/contrib/concurrency/concurrency.factor @@ -158,17 +158,14 @@ TUPLE: process node links pid mailbox ; #! that process terminates. localnode swap unit gensym unparse make-mailbox ; -#! The 'self-process' variable holds the currently executing process. -SYMBOL: self-process - : self ( -- process ) #! Returns the contents of the 'self-process' variables which #! is the process object for the current process. - self-process get ; + \ self get-global ; : init-main-process ( -- ) - #! Setup the main process. - make-process self-process set ; + #! Setup the main process. + make-process \ self set-global ; init-main-process @@ -176,7 +173,7 @@ init-main-process #! Calls the quotation with 'self' set #! to the given process. [ - self-process set + \ self set-global ] make-hash swap bind ; @@ -375,7 +372,7 @@ SYMBOL: quit-cc #! and jumping back into it from a spawn and keeping the 'self' #! variable correct. It's a workaround until I can find out how to #! stop 'self' from being clobbered back to its old value. - [ ] callcc1 dup process? [ self-process set f ] when ; + [ ] callcc1 dup process? [ \ self set-global f ] when ; : call-server-cc ( server-cc -- ) #! Calls the server continuation passing the current 'self'