jdk/test/java/lang/management/ThreadMXBean/Locks.java
changeset 1085 98cd842c1c5a
parent 2 90ce3da70b43
child 1247 b4c26443dee5
equal deleted inserted replaced
1084:4d4d63dfdef9 1085:98cd842c1c5a
   195         }
   195         }
   196         public void run() {
   196         public void run() {
   197             synchronized (ready) {
   197             synchronized (ready) {
   198                 // wait until WaitingThread about to wait for objC
   198                 // wait until WaitingThread about to wait for objC
   199                 thrsync.waitForSignal();
   199                 thrsync.waitForSignal();
   200                 // give chance to enter wait.
   200 
   201                 goSleep(100);
   201                 int retryCount = 0;
       
   202                 while (waiter.getState() != Thread.State.WAITING
       
   203                        && retryCount++ < 500) {
       
   204                    goSleep(100);
       
   205                 }
   202                 checkBlockedObject(waiter, objC, null, Thread.State.WAITING);
   206                 checkBlockedObject(waiter, objC, null, Thread.State.WAITING);
   203 
   207 
   204                 synchronized (objC) {
   208                 synchronized (objC) {
   205                     objC.notify();
   209                     objC.notify();
   206                 }
   210                 }