1 |
|
/* |
2 |
|
* Written by Doug Lea with assistance from members of JCP JSR-166 |
3 |
|
* Expert Group and released to the public domain, as explained at |
4 |
< |
* http://creativecommons.org/licenses/publicdomain |
4 |
> |
* http://creativecommons.org/publicdomain/zero/1.0/ |
5 |
|
*/ |
6 |
|
// Adapted from code that was in turn |
7 |
|
// Derived from SocketPerformanceTest.java - BugID: 4763450 |
29 |
|
static int HoldPop; |
30 |
|
static int HoldLimit; |
31 |
|
|
32 |
< |
static private boolean HoldCheck() { |
32 |
> |
private static boolean HoldCheck() { |
33 |
|
try { |
34 |
|
HoldQ.lock(); |
35 |
|
try { |
137 |
|
e.printStackTrace(); |
138 |
|
} |
139 |
|
} |
140 |
– |
|
141 |
– |
|
140 |
|
} |
141 |
|
|
142 |
|
public static void main(String[] args) throws Exception { |
219 |
|
if (false && j == 2) { |
220 |
|
System.out.print("Hold activated ..."); |
221 |
|
HoldQ.lock(); |
222 |
< |
try { |
222 |
> |
try { |
223 |
|
Hold = true; |
224 |
|
while (Hold) HoldQCond.await(); |
225 |
|
} |
228 |
|
} |
229 |
|
} |
230 |
|
|
233 |
– |
|
234 |
– |
|
231 |
|
// there's no synchronization here, so the total i get is |
232 |
|
// approximate, but that's OK since any i miss for this |
233 |
|
// sample will get credited to the next sample, and on average |