 ! Copyright (C) 2004, 2011 Slava Pestov.
 ! Copyright (C) 2005 Mackenzie Straight.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: alien.private arrays hashtables heaps kernel kernel.private
-math namespaces sequences vectors continuations continuations.private
-dlists assocs system combinators init boxes accessors math.order
-deques strings quotations fry ;
+USING: accessors alien.private arrays assocs boxes combinators
+continuations continuations.private deques dlists fry hashtables
+heaps init kernel kernel.private math math.order namespaces
+quotations sequences strings system ;
 FROM: assocs => change-at ;
 IN: threads
 


: interrupt ( thread -- )
    dup state>> [
        dup sleep-entry>> [ sleep-queue heap-delete ] when*
        f >>sleep-entry
        dup resume
    ] when drop ;

DEFER: stop

: unregister-thread ( thread -- )
    id>> threads delete-at ;

: set-self ( thread -- )
    OBJ-CURRENT-THREAD set-special-object ; inline

PRIVATE>

