On 1/26/19 7:43 PM, Daniel D. Daugherty wrote:
However, java_suspend_self() is careful and only self-suspends if
is_external_suspend() is still true (and it makes that check while
it owns the SR_lock). The code in java_suspend_self() has to be
careful in both directions. You don't want it to self-suspend
when it has been resumed by a racer and you don't want it to
resume if there was another SuspendThread() call was made and
has returned to it's caller. Check out the comments in
java_suspend_self(); they should help clarify things.
Thanks for the explanation. I was assuming that if you call suspend
and resume without synchronization, then all bets are off. But since
we already have some guarantees in place, it makes sense to
preserve them.
dl