|
Hi Leonid,
It looks good in general. Just a couple of comments. http://cr.openjdk.java.net/~lmesnik/8241123/webrev.01/test/hotspot/jtreg/vmTestbase/nsk/share/Wicket.java.frames.html 168 public int waitFor(long timeout) { 169 if (timeout < 0) 170 throw new IllegalArgumentException( 171 "timeout value is negative: " + timeout); 172 173 long id = System.currentTimeMillis(); 174 175 try { 176 lock.lock(); 177 --waiters; 178 if (debugOutput != null) { 179 debugOutput.printf("Wicket %d %s: waitFor(). There are %d waiters totally now.\n", id, name, waiters); 180 } 181 182 long waitTime = timeout; 183 long startTime = System.currentTimeMillis(); 184 185 while (count > 0 && waitTime > 0) { 186 try { 187 condition.await(waitTime, TimeUnit.MILLISECONDS); 188 } catch (InterruptedException e) { 189 } 190 waitTime = timeout - (System.currentTimeMillis() - startTime); 191 } 192 --waiters; 193 return count; 194 } finally { 195 lock.unlock(); 196 } 197 } The waiters probably needs to be incremented instead of decremented at line: 177 --waiters;
http://cr.openjdk.java.net/~lmesnik/8241123/webrev.01/test/hotspot/jtreg/vmTestbase/nsk/share/runner/ThreadsRunner.java.udiff.html private void waitForOtherThreads() {
if (shouldWait) {
shouldWait = false;
- finished.unlock();
- finished.waitFor();
+ finished.decrementAndGet();
+ while (finished.get() != 0) {
+ try {
+ Thread.sleep(1000);
+ } catch (InterruptedException ie) {
+ }
+ }
} else {
throw new TestBug("Waiting a second time is not premitted");
}
}Should we use a shorter sleep, something like Thread.sleep(100)? Thanks, Serguei On 3/18/20 15:18, Leonid Mesnik wrote:
|
- RFR: 8241123: Refactor vmTestbase stress framew... Leonid Mesnik
- Re: RFR: 8241123: Refactor vmTestbase stre... Igor Ignatyev
- Re: RFR: 8241123: Refactor vmTestbase ... Leonid Mesnik
- Re: RFR: 8241123: Refactor vmTestb... Igor Ignatyev
- Re: RFR: 8241123: Refactor vmTestbase ... Igor Ignatyev
- Re: RFR: 8241123: Refactor vmTestb... Leonid Mesnik
- Re: RFR: 8241123: Refactor vmT... Igor Ignatev
- Re: RFR: 8241123: Refacto... Leonid Mesnik
- Re: RFR: 8241123: Refactor vmT... [email protected]
