[Gc] Re: External thread suspension (again)

Keith Seitz keiths at redhat.com
Fri Jun 9 14:10:25 PDT 2006

Bryce McKinlay wrote:
> Keith Seitz wrote:
>> Hans Boehm wrote:
>>> Some comments/questions:
>>> 1) I don't see where the SUSPENDED flag gets set in response to
>>> GC_suspend_thread.  It gets set in GC_suspend_self(), but I don't
>>> think you get there unless it has already been set?
>> That gets set in GC_suspend_self. When GC_stop_world is called, 
>> GC_suspend_all will not signal the externally suspended thread 
>> (because GC_start_blocking will set thread_blocked).
> This works in the GC_suspend_self() case, but how does GC_start_blocking 
> get called in the GC_suspend_thread() case? Doesn't GC_suspend_thread() 
> need to set SUSPENDED before it sends the suspend signal?

Doh! I'm an idiot. Talk about not seeing the forest!

I've added that to the latest revision of the patch (which is attached 
for completeness).

[Hmm. Now that I see it, I wonder if it would be prudent to add some 
sanity checks to GC_suspend_thread, GC_suspend_self, and 
GC_resume_thread to make sure the thread is known to the GC, otherwise 
lookup_thread could return null...]


More information about the Gc mailing list