RFR: 8217618: JVM TI SuspendThread doesn't suspend the current thread before returning

dean.long at oracle.com dean.long at oracle.com
Sun Jan 27 20:39:53 UTC 2019


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


More information about the serviceability-dev mailing list