On Tue, 7 Feb 2023 00:56:21 GMT, David Holmes <dhol...@openjdk.org> wrote:

>> Chris Plummer has updated the pull request incrementally with one additional 
>> commit since the last revision:
>> 
>>   Get rid of Thread.sleep() in the invoked method can add warning comment.
>
> test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassType/invokeMethod/invokemethod011t.java
>  line 94:
> 
>> 92:         while(!doExit) {
>> 93:             l--; l++;
>> 94:             Thread.currentThread().sleep(0);
> 
> BTW this is an anti-pattern - use `Thread.sleep(n)` - it always applies to 
> the current thread.

What about replacing sleep(0) with yield()?
Do we expect it also causing deadlocks? Was it considered?

-------------

PR: https://git.openjdk.org/jdk/pull/12420

Reply via email to