threads: better error messages
							parent
							
								
									6737d2cdab
								
							
						
					
					
						commit
						516ce0c71d
					
				| 
						 | 
					@ -43,13 +43,15 @@ sleep-entry ;
 | 
				
			||||||
: thread-registered? ( thread -- ? )
 | 
					: thread-registered? ( thread -- ? )
 | 
				
			||||||
    id>> threads key? ;
 | 
					    id>> threads key? ;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					ERROR: already-stopped thread ;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
: check-unregistered ( thread -- thread )
 | 
					: check-unregistered ( thread -- thread )
 | 
				
			||||||
    dup thread-registered?
 | 
					    dup thread-registered? [ already-stopped ] when ;
 | 
				
			||||||
    [ "Thread already stopped" throw ] when ;
 | 
					
 | 
				
			||||||
 | 
					ERROR: not-running thread ;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
: check-registered ( thread -- thread )
 | 
					: check-registered ( thread -- thread )
 | 
				
			||||||
    dup thread-registered?
 | 
					    dup thread-registered? [ not-running ] unless ;
 | 
				
			||||||
    [ "Thread is not running" throw ] unless ;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
<PRIVATE
 | 
					<PRIVATE
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue