concurrency.mailboxes: break dependency on debugger vocab by creating concurrency.mailboxes.debugger

db4
Slava Pestov 2010-10-31 22:47:34 -05:00
parent 8be8c7f213
commit 372d2dc363
3 changed files with 12 additions and 5 deletions

View File

@ -0,0 +1 @@
Slava Pestov

View File

@ -0,0 +1,8 @@
! Copyright (C) 2010 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: debugger accessors debugger.threads kernel
concurrency.mailboxes ;
IN: concurrency.mailboxes.debugger
M: linked-error error.
[ thread>> error-in-thread. ] [ error>> error. ] bi ;

8
basis/concurrency/mailboxes/mailboxes.factor Normal file → Executable file
View File

@ -2,8 +2,7 @@
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: dlists deques threads sequences continuations namespaces USING: dlists deques threads sequences continuations namespaces
math quotations words kernel arrays assocs init system math quotations words kernel arrays assocs init system
concurrency.conditions accessors debugger debugger.threads concurrency.conditions accessors locals fry vocabs.loader ;
locals fry ;
IN: concurrency.mailboxes IN: concurrency.mailboxes
TUPLE: mailbox { threads dlist } { data dlist } ; TUPLE: mailbox { threads dlist } { data dlist } ;
@ -77,9 +76,6 @@ M: mailbox mailbox-get-timeout block-if-empty data>> pop-back ;
TUPLE: linked-error error thread ; TUPLE: linked-error error thread ;
M: linked-error error.
[ thread>> error-in-thread. ] [ error>> error. ] bi ;
C: <linked-error> linked-error C: <linked-error> linked-error
: ?linked ( message -- message ) : ?linked ( message -- message )
@ -95,3 +91,5 @@ M: linked-thread error-in-thread
: spawn-linked-to ( quot name mailbox -- thread ) : spawn-linked-to ( quot name mailbox -- thread )
<linked-thread> [ (spawn) ] keep ; <linked-thread> [ (spawn) ] keep ;
{ "concurrency.mailboxes" "debugger" } "concurrency.mailboxes.debugger" require-when