diff --git a/basis/threads/threads.factor b/basis/threads/threads.factor index cacc628e2a..dec44625f7 100644 --- a/basis/threads/threads.factor +++ b/basis/threads/threads.factor @@ -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 ;