Please, review this small patch for a test failing due to the updated implementation in JDK6.

Issue:  https://bugs.openjdk.java.net/browse/JDK-6309226
Webrev: http://cr.openjdk.java.net/~jbachorik/6309226/webrev.00/

The test fails due to the change in mustang where ThreadMXBean.getThreadInfo().getWaitedTime() and ThreadMXBean.getThreadInfo().getWaitedCount() include Thread.sleep() too. Unfortunately, Thread.sleep() is used throughout the test for synchronization purposes and this breaks the test.

In the patch I propose to replace Thread.sleep() with busy wait and hinting the scheduler by Thread.yield(). While not very elegant it successfully works around inclusion of unknown number of Thread.sleep()s (they are called in loop).

Thanks,

-JB-

Reply via email to