Mantis - Squeak
Viewing Issue Advanced Details
6822 Kernel major always 12-20-07 22:02 12-20-07 22:24
sig  
mikevdg  
normal  
assigned 3.10  
open  
none    
none  
0006822: Process>>resume causes running process which waiting for semaphore signal.
Following code should not make 'Oopsie' text to appear in transcript, since there was no semaphore signaled.

| sema proc |
 sema := Semaphore new.
 proc := [ sema critical: [ Transcript show: 'Oopsie' ] ] fork.
 Processor yield.
 proc suspend.
 proc resume.

Notes
(0011575)
mikevdg   
12-20-07 22:22   
The issue is that "proc resume" here ignores the fact that the process was waiting on a semaphore.

Another test case:

s := Semaphore new.
p := [ s wait. Transcript show: 'resumed'. ] fork.
p suspend.
p resume.

Note that Process>>signalException: (as of in Squeak 3.8, it may be fixed in later versions?) relies on this broken behaviour.