]> gitweb.factorcode.org Git - factor.git/blobdiff - basis/threads/threads.factor
basis: use lint.vocabs tool to trim using lists
[factor.git] / basis / threads / threads.factor
index ac23f04035bb5688e52dd37bb621f550a088e4a4..d56a7928ad3bb98037a875a1980999e74489b4e9 100644 (file)
@@ -2,8 +2,8 @@
 ! Copyright (C) 2005 Mackenzie Straight.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors alien.private arrays assocs boxes combinators
-continuations continuations.private deques dlists fry hashtables
-heaps init kernel kernel.private math math.order namespaces
+continuations continuations.private deques dlists hashtables
+heaps kernel kernel.private math math.order namespaces
 quotations sequences strings system ;
 IN: threads
 
@@ -13,16 +13,11 @@ PRIMITIVE: (set-context-and-delete) ( obj context -- * )
 PRIMITIVE: (sleep) ( nanos -- )
 PRIMITIVE: (start-context) ( obj quot -- obj' )
 PRIMITIVE: (start-context-and-delete) ( obj quot -- * )
-PRIMITIVE: callstack-for ( context -- array )
+
 PRIMITIVE: context-object-for ( n context -- obj )
-PRIMITIVE: datastack-for ( context -- array )
-PRIMITIVE: retainstack-for ( context -- array )
 
 ! Wrap sub-primitives; we don't want them inlined into callers
 ! since their behavior depends on what frames are on the callstack
-: context ( -- context )
-    CONTEXT-OBJ-CONTEXT context-object ; inline
-
 : set-context ( obj context -- obj' )
     (set-context) ; inline
 
@@ -56,16 +51,16 @@ PRIVATE>
 SYMBOL: initial-thread
 
 TUPLE: thread
-{ name string }
-{ quot callable initial: [ ] }
-{ exit-handler callable initial: [ ] }
-{ id integer }
-{ context box }
-state
-runnable
-mailbox
-{ variables hashtable }
-sleep-entry ;
+    { name string }
+    { quot callable initial: [ ] }
+    { exit-handler callable initial: [ ] }
+    { id integer }
+    { context box }
+    state
+    runnable
+    mailbox
+    { variables hashtable }
+    sleep-entry ;
 
 : self ( -- thread )
     OBJ-CURRENT-THREAD special-object { thread } declare ; inline
@@ -267,4 +262,4 @@ M: real sleep
 
 PRIVATE>
 
-[ init-threads ] "threads" add-startup-hook
+STARTUP-HOOK: init-threads