]> gitweb.factorcode.org Git - factor.git/commitdiff
Fix erg's bug
authorSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Tue, 29 Jul 2008 23:44:44 +0000 (18:44 -0500)
committerSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Tue, 29 Jul 2008 23:44:44 +0000 (18:44 -0500)
basis/threads/threads-tests.factor
basis/threads/threads.factor

index 122b7f1d59e73643fe2b935e20df4e191de6df5d..adac84338d53552f2f3fbaee6a65a6a1b7edd56c 100755 (executable)
@@ -41,3 +41,5 @@ yield
     ] ;
 
 [ t ] [ spawn-namespace-test ] unit-test
+
+[ "a" [ 1 1 + ] spawn 100 sleep ] must-fail
index 4b32f4519d92745382aea32e597d91a861b6f811..c406d0db126db98e1c6af417267eed4b3274088f 100755 (executable)
@@ -4,16 +4,22 @@
 USING: arrays hashtables heaps kernel kernel.private math
 namespaces sequences vectors continuations continuations.private
 dlists assocs system combinators init boxes accessors
-math.order dequeues ;
+math.order dequeues strings quotations ;
 IN: threads
 
 SYMBOL: initial-thread
 
 TUPLE: thread
-name quot exit-handler
-id
-continuation state runnable
-mailbox variables sleep-entry ;
+{ name string }
+{ quot callable initial: [ ] }
+{ exit-handler callable initial: [ ] }
+{ id integer }
+continuation
+state
+runnable
+mailbox
+variables
+sleep-entry ;
 
 : self ( -- thread ) 63 getenv ; inline
 
@@ -62,8 +68,7 @@ PRIVATE>
         swap >>name
         swap >>quot
         \ thread counter >>id
-        <box> >>continuation
-        [ ] >>exit-handler ; inline
+        <box> >>continuation ; inline
 
 : <thread> ( quot name -- thread )
     \ thread new-thread ;
@@ -211,7 +216,7 @@ GENERIC: error-in-thread ( error thread -- )
     <dlist> 65 setenv
     <min-heap> 66 setenv
     initial-thread global
-    [ drop f "Initial" <thread> ] cache
+    [ drop [ ] "Initial" <thread> ] cache
     <box> >>continuation
     t >>runnable
     f >>state