]> gitweb.factorcode.org Git - factor.git/commitdiff
threads: better error messages
authorSlava Pestov <slava@shill.local>
Tue, 7 Jul 2009 18:00:58 +0000 (13:00 -0500)
committerSlava Pestov <slava@shill.local>
Tue, 7 Jul 2009 18:00:58 +0000 (13:00 -0500)
basis/threads/threads.factor

index cacc628e2a5a6c7dff401bbc2cbf51b0f056de62..dec44625f72a74b10a023942b46fcc9cabc5183f 100644 (file)
@@ -43,13 +43,15 @@ sleep-entry ;
 : thread-registered? ( thread -- ? )
     id>> threads key? ;
 
+ERROR: already-stopped thread ;
+
 : check-unregistered ( thread -- thread )
-    dup thread-registered?
-    [ "Thread already stopped" throw ] when ;
+    dup thread-registered? [ already-stopped ] when ;
+
+ERROR: not-running thread ;
 
 : check-registered ( thread -- thread )
-    dup thread-registered?
-    [ "Thread is not running" throw ] unless ;
+    dup thread-registered? [ not-running ] unless ;
 
 <PRIVATE