| 
									
										
										
										
											2008-02-18 17:20:18 -05:00
										 |  |  | USING: concurrency.count-downs threads kernel tools.test ;
 | 
					
						
							| 
									
										
										
										
											2008-03-01 17:00:45 -05:00
										 |  |  | IN: concurrency.count-downs.tests` | 
					
						
							| 
									
										
										
										
											2008-02-18 17:20:18 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  | [ ] [ 0 <count-down> await ] unit-test | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | [ 1 <count-down> dup count-down count-down ] must-fail | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | [ ] [ | 
					
						
							|  |  |  |     1 <count-down> | 
					
						
							|  |  |  |     3 <count-down> | 
					
						
							|  |  |  |     2dup [ await count-down ] 2curry "Master" spawn drop
 | 
					
						
							|  |  |  |     dup [ count-down ] curry "Slave" spawn drop
 | 
					
						
							|  |  |  |     dup [ count-down ] curry "Slave" spawn drop
 | 
					
						
							|  |  |  |     dup [ count-down ] curry "Slave" spawn drop
 | 
					
						
							|  |  |  |     drop await | 
					
						
							|  |  |  | ] unit-test |