Fix concurrency:fulfill unbalanced stack issue
							parent
							
								
									b832d8dedb
								
							
						
					
					
						commit
						5f3dde7e26
					
				| 
						 | 
					@ -287,12 +287,14 @@ TUPLE: promise fulfilled? value processes ;
 | 
				
			||||||
    #! Set the future of the promise to the given value. Threads
 | 
					    #! Set the future of the promise to the given value. Threads
 | 
				
			||||||
    #! blocking on the promise will then be released.
 | 
					    #! blocking on the promise will then be released.
 | 
				
			||||||
    dup promise-fulfilled? [ 
 | 
					    dup promise-fulfilled? [ 
 | 
				
			||||||
 | 
					        2drop
 | 
				
			||||||
 | 
					    ] [
 | 
				
			||||||
        [ set-promise-value ] keep
 | 
					        [ set-promise-value ] keep
 | 
				
			||||||
        [ t swap set-promise-fulfilled? ] keep
 | 
					        [ t swap set-promise-fulfilled? ] keep
 | 
				
			||||||
        [ promise-processes ] keep
 | 
					        [ promise-processes ] keep
 | 
				
			||||||
        0 <vector> swap set-promise-processes
 | 
					        0 <vector> swap set-promise-processes
 | 
				
			||||||
        [ schedule-thread ] each yield
 | 
					        [ schedule-thread ] each yield
 | 
				
			||||||
    ] unless ;
 | 
					    ] if ;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<PRIVATE
 | 
					<PRIVATE
 | 
				
			||||||
 : (maybe-block-promise) ( promise -- promise )
 | 
					 : (maybe-block-promise) ( promise -- promise )
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue