[Bug 209233] [patch] pthread_suspend_all_np races with check_suspend

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Wed May 4 16:56:31 UTC 2016


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=209233

--- Comment #5 from Lawrence Esswood <le277 at cam.ac.uk> ---
(In reply to Konstantin Belousov from comment #3)

I had a very wonky test that very unreliably failed, now I know why it happens
I can probably create a much better one to attach.

Your suggestion I think would work. You would also have to change the break
condition on the check_suspend loop otherwise if the thread is woken for any
reason it will break too early.

One question however, what happens if the thread in check_suspend has its
NEED_SUSPEND flag set and is signalled somewhere between the loop exit and the
_thr_signal_unblock? I think it won't do another check_suspend / check_deferred
until it next hits a _thr_ast which might be never. We could maybe extend the
thread lock to include the _thr_signal_unblock, or have the end of
check_suspend make a recursive call.

I will try knock up a test case.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-threads mailing list