- 
    Bug 
- 
    Resolution: Not an Issue
- 
     P4 P4
- 
    None
- 
    hs18
- 
        generic
- 
        generic
                    The following core doesn't throw an Error as expected:
import java.util.concurrent.Semaphore;
public class PermitOverflow {
public static void main(String[] args) throws Throwable {
for (boolean fair : new boolean[] { true, false }) {
Semaphore sem = new Semaphore(Integer.MAX_VALUE - 1, fair);
if (sem.availablePermits() != Integer.MAX_VALUE - 1)
throw new RuntimeException();
try {
sem.release(2);
} catch (Error expected) {
}
...
}
            
import java.util.concurrent.Semaphore;
public class PermitOverflow {
public static void main(String[] args) throws Throwable {
for (boolean fair : new boolean[] { true, false }) {
Semaphore sem = new Semaphore(Integer.MAX_VALUE - 1, fair);
if (sem.availablePermits() != Integer.MAX_VALUE - 1)
throw new RuntimeException();
try {
sem.release(2);
} catch (Error expected) {
}
...
}
- relates to
- 
                    JDK-6941130 Semaphore acquire method can hang. -           
- Resolved
 
-