public class java.util.concurrent.Semaphore implements java.io.Serializable
minor version: 0
major version: 59
flags: flags: (0x0021) ACC_PUBLIC, ACC_SUPER
this_class: java.util.concurrent.Semaphore
super_class: java.lang.Object
{
private static final long serialVersionUID;
descriptor: J
flags: (0x001a) ACC_PRIVATE, ACC_STATIC, ACC_FINAL
ConstantValue: -3222578661600680210
private final java.util.concurrent.Semaphore$Sync sync;
descriptor: Ljava/util/concurrent/Semaphore$Sync;
flags: (0x0012) ACC_PRIVATE, ACC_FINAL
public void <init>(int);
descriptor: (I)V
flags: (0x0001) ACC_PUBLIC
Code:
stack=4, locals=2, args_size=2
start local 0 start local 1 0: aload 0
invokespecial java.lang.Object.<init>:()V
1: aload 0
new java.util.concurrent.Semaphore$NonfairSync
dup
iload 1
invokespecial java.util.concurrent.Semaphore$NonfairSync.<init>:(I)V
putfield java.util.concurrent.Semaphore.sync:Ljava/util/concurrent/Semaphore$Sync;
2: return
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 3 0 this Ljava/util/concurrent/Semaphore;
0 3 1 permits I
MethodParameters:
Name Flags
permits
public void <init>(int, boolean);
descriptor: (IZ)V
flags: (0x0001) ACC_PUBLIC
Code:
stack=4, locals=3, args_size=3
start local 0 start local 1 start local 2 0: aload 0
invokespecial java.lang.Object.<init>:()V
1: aload 0
iload 2
ifeq 2
new java.util.concurrent.Semaphore$FairSync
dup
iload 1
invokespecial java.util.concurrent.Semaphore$FairSync.<init>:(I)V
goto 3
StackMap locals: java.util.concurrent.Semaphore int int
StackMap stack: java.util.concurrent.Semaphore
2: new java.util.concurrent.Semaphore$NonfairSync
dup
iload 1
invokespecial java.util.concurrent.Semaphore$NonfairSync.<init>:(I)V
StackMap locals: java.util.concurrent.Semaphore int int
StackMap stack: java.util.concurrent.Semaphore java.util.concurrent.Semaphore$Sync
3: putfield java.util.concurrent.Semaphore.sync:Ljava/util/concurrent/Semaphore$Sync;
4: return
end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 5 0 this Ljava/util/concurrent/Semaphore;
0 5 1 permits I
0 5 2 fair Z
MethodParameters:
Name Flags
permits
fair
public void acquire();
descriptor: ()V
flags: (0x0001) ACC_PUBLIC
Code:
stack=2, locals=1, args_size=1
start local 0 0: aload 0
getfield java.util.concurrent.Semaphore.sync:Ljava/util/concurrent/Semaphore$Sync;
iconst_1
invokevirtual java.util.concurrent.Semaphore$Sync.acquireSharedInterruptibly:(I)V
1: return
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 2 0 this Ljava/util/concurrent/Semaphore;
Exceptions:
throws java.lang.InterruptedException
public void acquireUninterruptibly();
descriptor: ()V
flags: (0x0001) ACC_PUBLIC
Code:
stack=2, locals=1, args_size=1
start local 0 0: aload 0
getfield java.util.concurrent.Semaphore.sync:Ljava/util/concurrent/Semaphore$Sync;
iconst_1
invokevirtual java.util.concurrent.Semaphore$Sync.acquireShared:(I)V
1: return
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 2 0 this Ljava/util/concurrent/Semaphore;
public boolean tryAcquire();
descriptor: ()Z
flags: (0x0001) ACC_PUBLIC
Code:
stack=2, locals=1, args_size=1
start local 0 0: aload 0
getfield java.util.concurrent.Semaphore.sync:Ljava/util/concurrent/Semaphore$Sync;
iconst_1
invokevirtual java.util.concurrent.Semaphore$Sync.nonfairTryAcquireShared:(I)I
iflt 1
iconst_1
ireturn
StackMap locals:
StackMap stack:
1: iconst_0
ireturn
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 2 0 this Ljava/util/concurrent/Semaphore;
public boolean tryAcquire(long, java.util.concurrent.TimeUnit);
descriptor: (JLjava/util/concurrent/TimeUnit;)Z
flags: (0x0001) ACC_PUBLIC
Code:
stack=5, locals=4, args_size=3
start local 0 start local 1 start local 3 0: aload 0
getfield java.util.concurrent.Semaphore.sync:Ljava/util/concurrent/Semaphore$Sync;
iconst_1
aload 3
lload 1
invokevirtual java.util.concurrent.TimeUnit.toNanos:(J)J
invokevirtual java.util.concurrent.Semaphore$Sync.tryAcquireSharedNanos:(IJ)Z
ireturn
end local 3 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 1 0 this Ljava/util/concurrent/Semaphore;
0 1 1 timeout J
0 1 3 unit Ljava/util/concurrent/TimeUnit;
Exceptions:
throws java.lang.InterruptedException
MethodParameters:
Name Flags
timeout
unit
public void release();
descriptor: ()V
flags: (0x0001) ACC_PUBLIC
Code:
stack=2, locals=1, args_size=1
start local 0 0: aload 0
getfield java.util.concurrent.Semaphore.sync:Ljava/util/concurrent/Semaphore$Sync;
iconst_1
invokevirtual java.util.concurrent.Semaphore$Sync.releaseShared:(I)Z
pop
1: return
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 2 0 this Ljava/util/concurrent/Semaphore;
public void acquire(int);
descriptor: (I)V
flags: (0x0001) ACC_PUBLIC
Code:
stack=2, locals=2, args_size=2
start local 0 start local 1 0: iload 1
ifge 1
new java.lang.IllegalArgumentException
dup
invokespecial java.lang.IllegalArgumentException.<init>:()V
athrow
1: StackMap locals:
StackMap stack:
aload 0
getfield java.util.concurrent.Semaphore.sync:Ljava/util/concurrent/Semaphore$Sync;
iload 1
invokevirtual java.util.concurrent.Semaphore$Sync.acquireSharedInterruptibly:(I)V
2: return
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 3 0 this Ljava/util/concurrent/Semaphore;
0 3 1 permits I
Exceptions:
throws java.lang.InterruptedException
MethodParameters:
Name Flags
permits
public void acquireUninterruptibly(int);
descriptor: (I)V
flags: (0x0001) ACC_PUBLIC
Code:
stack=2, locals=2, args_size=2
start local 0 start local 1 0: iload 1
ifge 1
new java.lang.IllegalArgumentException
dup
invokespecial java.lang.IllegalArgumentException.<init>:()V
athrow
1: StackMap locals:
StackMap stack:
aload 0
getfield java.util.concurrent.Semaphore.sync:Ljava/util/concurrent/Semaphore$Sync;
iload 1
invokevirtual java.util.concurrent.Semaphore$Sync.acquireShared:(I)V
2: return
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 3 0 this Ljava/util/concurrent/Semaphore;
0 3 1 permits I
MethodParameters:
Name Flags
permits
public boolean tryAcquire(int);
descriptor: (I)Z
flags: (0x0001) ACC_PUBLIC
Code:
stack=2, locals=2, args_size=2
start local 0 start local 1 0: iload 1
ifge 1
new java.lang.IllegalArgumentException
dup
invokespecial java.lang.IllegalArgumentException.<init>:()V
athrow
1: StackMap locals:
StackMap stack:
aload 0
getfield java.util.concurrent.Semaphore.sync:Ljava/util/concurrent/Semaphore$Sync;
iload 1
invokevirtual java.util.concurrent.Semaphore$Sync.nonfairTryAcquireShared:(I)I
iflt 2
iconst_1
ireturn
StackMap locals:
StackMap stack:
2: iconst_0
ireturn
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 3 0 this Ljava/util/concurrent/Semaphore;
0 3 1 permits I
MethodParameters:
Name Flags
permits
public boolean tryAcquire(int, long, java.util.concurrent.TimeUnit);
descriptor: (IJLjava/util/concurrent/TimeUnit;)Z
flags: (0x0001) ACC_PUBLIC
Code:
stack=5, locals=5, args_size=4
start local 0 start local 1 start local 2 start local 4 0: iload 1
ifge 1
new java.lang.IllegalArgumentException
dup
invokespecial java.lang.IllegalArgumentException.<init>:()V
athrow
1: StackMap locals:
StackMap stack:
aload 0
getfield java.util.concurrent.Semaphore.sync:Ljava/util/concurrent/Semaphore$Sync;
iload 1
aload 4
lload 2
invokevirtual java.util.concurrent.TimeUnit.toNanos:(J)J
invokevirtual java.util.concurrent.Semaphore$Sync.tryAcquireSharedNanos:(IJ)Z
ireturn
end local 4 end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 2 0 this Ljava/util/concurrent/Semaphore;
0 2 1 permits I
0 2 2 timeout J
0 2 4 unit Ljava/util/concurrent/TimeUnit;
Exceptions:
throws java.lang.InterruptedException
MethodParameters:
Name Flags
permits
timeout
unit
public void release(int);
descriptor: (I)V
flags: (0x0001) ACC_PUBLIC
Code:
stack=2, locals=2, args_size=2
start local 0 start local 1 0: iload 1
ifge 1
new java.lang.IllegalArgumentException
dup
invokespecial java.lang.IllegalArgumentException.<init>:()V
athrow
1: StackMap locals:
StackMap stack:
aload 0
getfield java.util.concurrent.Semaphore.sync:Ljava/util/concurrent/Semaphore$Sync;
iload 1
invokevirtual java.util.concurrent.Semaphore$Sync.releaseShared:(I)Z
pop
2: return
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 3 0 this Ljava/util/concurrent/Semaphore;
0 3 1 permits I
MethodParameters:
Name Flags
permits
public int availablePermits();
descriptor: ()I
flags: (0x0001) ACC_PUBLIC
Code:
stack=1, locals=1, args_size=1
start local 0 0: aload 0
getfield java.util.concurrent.Semaphore.sync:Ljava/util/concurrent/Semaphore$Sync;
invokevirtual java.util.concurrent.Semaphore$Sync.getPermits:()I
ireturn
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 1 0 this Ljava/util/concurrent/Semaphore;
public int drainPermits();
descriptor: ()I
flags: (0x0001) ACC_PUBLIC
Code:
stack=1, locals=1, args_size=1
start local 0 0: aload 0
getfield java.util.concurrent.Semaphore.sync:Ljava/util/concurrent/Semaphore$Sync;
invokevirtual java.util.concurrent.Semaphore$Sync.drainPermits:()I
ireturn
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 1 0 this Ljava/util/concurrent/Semaphore;
protected void reducePermits(int);
descriptor: (I)V
flags: (0x0004) ACC_PROTECTED
Code:
stack=2, locals=2, args_size=2
start local 0 start local 1 0: iload 1
ifge 1
new java.lang.IllegalArgumentException
dup
invokespecial java.lang.IllegalArgumentException.<init>:()V
athrow
1: StackMap locals:
StackMap stack:
aload 0
getfield java.util.concurrent.Semaphore.sync:Ljava/util/concurrent/Semaphore$Sync;
iload 1
invokevirtual java.util.concurrent.Semaphore$Sync.reducePermits:(I)V
2: return
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 3 0 this Ljava/util/concurrent/Semaphore;
0 3 1 reduction I
MethodParameters:
Name Flags
reduction
public boolean isFair();
descriptor: ()Z
flags: (0x0001) ACC_PUBLIC
Code:
stack=1, locals=1, args_size=1
start local 0 0: aload 0
getfield java.util.concurrent.Semaphore.sync:Ljava/util/concurrent/Semaphore$Sync;
instanceof java.util.concurrent.Semaphore$FairSync
ireturn
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 1 0 this Ljava/util/concurrent/Semaphore;
public final boolean hasQueuedThreads();
descriptor: ()Z
flags: (0x0011) ACC_PUBLIC, ACC_FINAL
Code:
stack=1, locals=1, args_size=1
start local 0 0: aload 0
getfield java.util.concurrent.Semaphore.sync:Ljava/util/concurrent/Semaphore$Sync;
invokevirtual java.util.concurrent.Semaphore$Sync.hasQueuedThreads:()Z
ireturn
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 1 0 this Ljava/util/concurrent/Semaphore;
public final int getQueueLength();
descriptor: ()I
flags: (0x0011) ACC_PUBLIC, ACC_FINAL
Code:
stack=1, locals=1, args_size=1
start local 0 0: aload 0
getfield java.util.concurrent.Semaphore.sync:Ljava/util/concurrent/Semaphore$Sync;
invokevirtual java.util.concurrent.Semaphore$Sync.getQueueLength:()I
ireturn
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 1 0 this Ljava/util/concurrent/Semaphore;
protected java.util.Collection<java.lang.Thread> getQueuedThreads();
descriptor: ()Ljava/util/Collection;
flags: (0x0004) ACC_PROTECTED
Code:
stack=1, locals=1, args_size=1
start local 0 0: aload 0
getfield java.util.concurrent.Semaphore.sync:Ljava/util/concurrent/Semaphore$Sync;
invokevirtual java.util.concurrent.Semaphore$Sync.getQueuedThreads:()Ljava/util/Collection;
areturn
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 1 0 this Ljava/util/concurrent/Semaphore;
Signature: ()Ljava/util/Collection<Ljava/lang/Thread;>;
public java.lang.String toString();
descriptor: ()Ljava/lang/String;
flags: (0x0001) ACC_PUBLIC
Code:
stack=3, locals=1, args_size=1
start local 0 0: new java.lang.StringBuilder
dup
aload 0
invokespecial java.lang.Object.toString:()Ljava/lang/String;
invokestatic java.lang.String.valueOf:(Ljava/lang/Object;)Ljava/lang/String;
invokespecial java.lang.StringBuilder.<init>:(Ljava/lang/String;)V
ldc "[Permits = "
invokevirtual java.lang.StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
aload 0
getfield java.util.concurrent.Semaphore.sync:Ljava/util/concurrent/Semaphore$Sync;
invokevirtual java.util.concurrent.Semaphore$Sync.getPermits:()I
invokevirtual java.lang.StringBuilder.append:(I)Ljava/lang/StringBuilder;
ldc "]"
invokevirtual java.lang.StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
invokevirtual java.lang.StringBuilder.toString:()Ljava/lang/String;
areturn
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 1 0 this Ljava/util/concurrent/Semaphore;
}
SourceFile: "Semaphore.java"
NestMembers:
java.util.concurrent.Semaphore$FairSync java.util.concurrent.Semaphore$NonfairSync java.util.concurrent.Semaphore$Sync
InnerClasses:
final FairSync = java.util.concurrent.Semaphore$FairSync of java.util.concurrent.Semaphore
final NonfairSync = java.util.concurrent.Semaphore$NonfairSync of java.util.concurrent.Semaphore
abstract Sync = java.util.concurrent.Semaphore$Sync of java.util.concurrent.Semaphore