public class org.jruby.ext.thread.Mutex extends org.jruby.RubyObject implements org.jruby.runtime.marshal.DataType
minor version: 0
major version: 59
flags: flags: (0x0021) ACC_PUBLIC, ACC_SUPER
this_class: org.jruby.ext.thread.Mutex
super_class: org.jruby.RubyObject
{
java.util.concurrent.locks.ReentrantLock lock;
descriptor: Ljava/util/concurrent/locks/ReentrantLock;
flags: (0x0000)
public static org.jruby.ext.thread.Mutex newInstance(org.jruby.runtime.ThreadContext, org.jruby.runtime.builtin.IRubyObject, org.jruby.runtime.builtin.IRubyObject[], org.jruby.runtime.Block);
descriptor: (Lorg/jruby/runtime/ThreadContext;Lorg/jruby/runtime/builtin/IRubyObject;[Lorg/jruby/runtime/builtin/IRubyObject;Lorg/jruby/runtime/Block;)Lorg/jruby/ext/thread/Mutex;
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=4, locals=5, args_size=4
start local 0 start local 1 start local 2 start local 3 0: new org.jruby.ext.thread.Mutex
dup
aload 0
getfield org.jruby.runtime.ThreadContext.runtime:Lorg/jruby/Ruby;
aload 1
checkcast org.jruby.RubyClass
invokespecial org.jruby.ext.thread.Mutex.<init>:(Lorg/jruby/Ruby;Lorg/jruby/RubyClass;)V
astore 4
start local 4 1: aload 4
aload 0
aload 2
aload 3
invokevirtual org.jruby.ext.thread.Mutex.callInit:(Lorg/jruby/runtime/ThreadContext;[Lorg/jruby/runtime/builtin/IRubyObject;Lorg/jruby/runtime/Block;)V
2: aload 4
areturn
end local 4 end local 3 end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 3 0 context Lorg/jruby/runtime/ThreadContext;
0 3 1 recv Lorg/jruby/runtime/builtin/IRubyObject;
0 3 2 args [Lorg/jruby/runtime/builtin/IRubyObject;
0 3 3 block Lorg/jruby/runtime/Block;
1 3 4 result Lorg/jruby/ext/thread/Mutex;
RuntimeVisibleAnnotations:
org.jruby.anno.JRubyMethod(name = {"new"}, rest = true, meta = true)
MethodParameters:
Name Flags
context
recv
args
block
public void <init>(org.jruby.Ruby, org.jruby.RubyClass);
descriptor: (Lorg/jruby/Ruby;Lorg/jruby/RubyClass;)V
flags: (0x0001) ACC_PUBLIC
Code:
stack=3, locals=3, args_size=3
start local 0 start local 1 start local 2 0: aload 0
aload 1
aload 2
invokespecial org.jruby.RubyObject.<init>:(Lorg/jruby/Ruby;Lorg/jruby/RubyClass;)V
1: aload 0
new java.util.concurrent.locks.ReentrantLock
dup
invokespecial java.util.concurrent.locks.ReentrantLock.<init>:()V
putfield org.jruby.ext.thread.Mutex.lock:Ljava/util/concurrent/locks/ReentrantLock;
2: return
end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 3 0 this Lorg/jruby/ext/thread/Mutex;
0 3 1 runtime Lorg/jruby/Ruby;
0 3 2 type Lorg/jruby/RubyClass;
MethodParameters:
Name Flags
runtime
type
public static void setup(org.jruby.Ruby);
descriptor: (Lorg/jruby/Ruby;)V
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=5, locals=2, args_size=1
start local 0 0: aload 0
invokevirtual org.jruby.Ruby.getThread:()Lorg/jruby/RubyClass;
ldc "Mutex"
aload 0
invokevirtual org.jruby.Ruby.getObject:()Lorg/jruby/RubyClass;
new org.jruby.ext.thread.Mutex$1
dup
invokespecial org.jruby.ext.thread.Mutex$1.<init>:()V
invokevirtual org.jruby.RubyClass.defineClassUnder:(Ljava/lang/String;Lorg/jruby/RubyClass;Lorg/jruby/runtime/ObjectAllocator;)Lorg/jruby/RubyClass;
astore 1
start local 1 1: aload 1
ldc Lorg/jruby/ext/thread/Mutex;
invokevirtual org.jruby.RubyClass.setReifiedClass:(Ljava/lang/Class;)V
2: aload 1
ldc Lorg/jruby/ext/thread/Mutex;
invokevirtual org.jruby.RubyClass.defineAnnotatedMethods:(Ljava/lang/Class;)V
3: aload 0
invokevirtual org.jruby.Ruby.getObject:()Lorg/jruby/RubyClass;
ldc "Mutex"
aload 1
invokevirtual org.jruby.RubyClass.setConstant:(Ljava/lang/String;Lorg/jruby/runtime/builtin/IRubyObject;)Lorg/jruby/runtime/builtin/IRubyObject;
pop
4: return
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 5 0 runtime Lorg/jruby/Ruby;
1 5 1 cMutex Lorg/jruby/RubyClass;
MethodParameters:
Name Flags
runtime
public org.jruby.RubyBoolean locked_p(org.jruby.runtime.ThreadContext);
descriptor: (Lorg/jruby/runtime/ThreadContext;)Lorg/jruby/RubyBoolean;
flags: (0x0001) ACC_PUBLIC
Code:
stack=2, locals=2, args_size=2
start local 0 start local 1 0: aload 1
getfield org.jruby.runtime.ThreadContext.runtime:Lorg/jruby/Ruby;
aload 0
getfield org.jruby.ext.thread.Mutex.lock:Ljava/util/concurrent/locks/ReentrantLock;
invokevirtual java.util.concurrent.locks.ReentrantLock.isLocked:()Z
invokevirtual org.jruby.Ruby.newBoolean:(Z)Lorg/jruby/RubyBoolean;
areturn
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 1 0 this Lorg/jruby/ext/thread/Mutex;
0 1 1 context Lorg/jruby/runtime/ThreadContext;
RuntimeVisibleAnnotations:
org.jruby.anno.JRubyMethod(name = {"locked?"})
MethodParameters:
Name Flags
context
public org.jruby.RubyBoolean try_lock(org.jruby.runtime.ThreadContext);
descriptor: (Lorg/jruby/runtime/ThreadContext;)Lorg/jruby/RubyBoolean;
flags: (0x0001) ACC_PUBLIC
Code:
stack=3, locals=2, args_size=2
start local 0 start local 1 0: aload 0
getfield org.jruby.ext.thread.Mutex.lock:Ljava/util/concurrent/locks/ReentrantLock;
invokevirtual java.util.concurrent.locks.ReentrantLock.isHeldByCurrentThread:()Z
ifeq 2
1: aload 1
getfield org.jruby.runtime.ThreadContext.fals:Lorg/jruby/RubyBoolean;
areturn
2: StackMap locals:
StackMap stack:
aload 1
getfield org.jruby.runtime.ThreadContext.runtime:Lorg/jruby/Ruby;
aload 1
invokevirtual org.jruby.runtime.ThreadContext.getThread:()Lorg/jruby/RubyThread;
aload 0
getfield org.jruby.ext.thread.Mutex.lock:Ljava/util/concurrent/locks/ReentrantLock;
invokevirtual org.jruby.RubyThread.tryLock:(Ljava/util/concurrent/locks/Lock;)Z
invokevirtual org.jruby.Ruby.newBoolean:(Z)Lorg/jruby/RubyBoolean;
areturn
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 3 0 this Lorg/jruby/ext/thread/Mutex;
0 3 1 context Lorg/jruby/runtime/ThreadContext;
RuntimeVisibleAnnotations:
org.jruby.anno.JRubyMethod()
MethodParameters:
Name Flags
context
public org.jruby.runtime.builtin.IRubyObject lock(org.jruby.runtime.ThreadContext);
descriptor: (Lorg/jruby/runtime/ThreadContext;)Lorg/jruby/runtime/builtin/IRubyObject;
flags: (0x0001) ACC_PUBLIC
Code:
stack=2, locals=3, args_size=2
start local 0 start local 1 0: aload 1
invokevirtual org.jruby.runtime.ThreadContext.getThread:()Lorg/jruby/RubyThread;
astore 2
start local 2 1: aload 0
aload 1
invokevirtual org.jruby.ext.thread.Mutex.checkRelocking:(Lorg/jruby/runtime/ThreadContext;)V
2: aload 2
aload 0
getfield org.jruby.ext.thread.Mutex.lock:Ljava/util/concurrent/locks/ReentrantLock;
invokevirtual org.jruby.RubyThread.tryLock:(Ljava/util/concurrent/locks/Lock;)Z
ifne 9
3: StackMap locals: org.jruby.RubyThread
StackMap stack:
aload 1
invokevirtual org.jruby.runtime.ThreadContext.getThread:()Lorg/jruby/RubyThread;
aload 0
getfield org.jruby.ext.thread.Mutex.lock:Ljava/util/concurrent/locks/ReentrantLock;
invokevirtual org.jruby.RubyThread.lockInterruptibly:(Ljava/util/concurrent/locks/Lock;)V
4: aload 0
5: areturn
6: StackMap locals:
StackMap stack: java.lang.InterruptedException
pop
7: aload 1
invokevirtual org.jruby.runtime.ThreadContext.pollThreadEvents:()V
8: goto 3
9: StackMap locals:
StackMap stack:
aload 0
areturn
end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 10 0 this Lorg/jruby/ext/thread/Mutex;
0 10 1 context Lorg/jruby/runtime/ThreadContext;
1 10 2 thread Lorg/jruby/RubyThread;
Exception table:
from to target type
3 5 6 Class java.lang.InterruptedException
RuntimeVisibleAnnotations:
org.jruby.anno.JRubyMethod()
MethodParameters:
Name Flags
context
public org.jruby.runtime.builtin.IRubyObject unlock(org.jruby.runtime.ThreadContext);
descriptor: (Lorg/jruby/runtime/ThreadContext;)Lorg/jruby/runtime/builtin/IRubyObject;
flags: (0x0001) ACC_PUBLIC
Code:
stack=2, locals=3, args_size=2
start local 0 start local 1 0: aload 0
getfield org.jruby.ext.thread.Mutex.lock:Ljava/util/concurrent/locks/ReentrantLock;
invokevirtual java.util.concurrent.locks.ReentrantLock.isLocked:()Z
ifne 2
1: aload 1
getfield org.jruby.runtime.ThreadContext.runtime:Lorg/jruby/Ruby;
ldc "Mutex is not locked"
invokevirtual org.jruby.Ruby.newThreadError:(Ljava/lang/String;)Lorg/jruby/exceptions/RaiseException;
athrow
2: StackMap locals:
StackMap stack:
aload 0
getfield org.jruby.ext.thread.Mutex.lock:Ljava/util/concurrent/locks/ReentrantLock;
invokevirtual java.util.concurrent.locks.ReentrantLock.isHeldByCurrentThread:()Z
ifne 4
3: aload 1
getfield org.jruby.runtime.ThreadContext.runtime:Lorg/jruby/Ruby;
ldc "Mutex is not owned by calling thread"
invokevirtual org.jruby.Ruby.newThreadError:(Ljava/lang/String;)Lorg/jruby/exceptions/RaiseException;
athrow
4: StackMap locals:
StackMap stack:
aload 0
getfield org.jruby.ext.thread.Mutex.lock:Ljava/util/concurrent/locks/ReentrantLock;
invokevirtual java.util.concurrent.locks.ReentrantLock.hasQueuedThreads:()Z
istore 2
start local 2 5: aload 1
invokevirtual org.jruby.runtime.ThreadContext.getThread:()Lorg/jruby/RubyThread;
aload 0
getfield org.jruby.ext.thread.Mutex.lock:Ljava/util/concurrent/locks/ReentrantLock;
invokevirtual org.jruby.RubyThread.unlock:(Ljava/util/concurrent/locks/Lock;)V
6: iload 2
ifeq 7
aload 1
getfield org.jruby.runtime.ThreadContext.nil:Lorg/jruby/runtime/builtin/IRubyObject;
goto 8
StackMap locals: int
StackMap stack:
7: aload 0
StackMap locals:
StackMap stack: org.jruby.runtime.builtin.IRubyObject
8: areturn
end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 9 0 this Lorg/jruby/ext/thread/Mutex;
0 9 1 context Lorg/jruby/runtime/ThreadContext;
5 9 2 hasQueued Z
RuntimeVisibleAnnotations:
org.jruby.anno.JRubyMethod()
MethodParameters:
Name Flags
context
public org.jruby.runtime.builtin.IRubyObject sleep(org.jruby.runtime.ThreadContext);
descriptor: (Lorg/jruby/runtime/ThreadContext;)Lorg/jruby/runtime/builtin/IRubyObject;
flags: (0x0001) ACC_PUBLIC
Code:
stack=3, locals=2, args_size=2
start local 0 start local 1 0: aload 0
aload 1
aload 1
getfield org.jruby.runtime.ThreadContext.nil:Lorg/jruby/runtime/builtin/IRubyObject;
invokevirtual org.jruby.ext.thread.Mutex.sleep:(Lorg/jruby/runtime/ThreadContext;Lorg/jruby/runtime/builtin/IRubyObject;)Lorg/jruby/runtime/builtin/IRubyObject;
areturn
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 1 0 this Lorg/jruby/ext/thread/Mutex;
0 1 1 context Lorg/jruby/runtime/ThreadContext;
RuntimeVisibleAnnotations:
org.jruby.anno.JRubyMethod()
MethodParameters:
Name Flags
context
public org.jruby.runtime.builtin.IRubyObject sleep(org.jruby.runtime.ThreadContext, org.jruby.runtime.builtin.IRubyObject);
descriptor: (Lorg/jruby/runtime/ThreadContext;Lorg/jruby/runtime/builtin/IRubyObject;)Lorg/jruby/runtime/builtin/IRubyObject;
flags: (0x0001) ACC_PUBLIC
Code:
stack=5, locals=11, args_size=3
start local 0 start local 1 start local 2 0: aload 1
getfield org.jruby.runtime.ThreadContext.runtime:Lorg/jruby/Ruby;
astore 3
start local 3 1: invokestatic java.lang.System.currentTimeMillis:()J
lstore 4
start local 4 2: aload 1
invokevirtual org.jruby.runtime.ThreadContext.getThread:()Lorg/jruby/RubyThread;
astore 6
start local 6 3: aload 2
invokeinterface org.jruby.runtime.builtin.IRubyObject.isNil:()Z
ifeq 6
4: aload 6
aload 0
getfield org.jruby.ext.thread.Mutex.lock:Ljava/util/concurrent/locks/ReentrantLock;
invokevirtual org.jruby.RubyThread.sleep:(Ljava/util/concurrent/locks/Lock;)V
5: goto 15
6: StackMap locals: org.jruby.Ruby long org.jruby.RubyThread
StackMap stack:
aload 1
aload 2
invokestatic org.jruby.RubyTime.convertTimeInterval:(Lorg/jruby/runtime/ThreadContext;Lorg/jruby/runtime/builtin/IRubyObject;)D
dstore 7
start local 7 7: dload 7
ldc 1000.0
dmul
d2l
lstore 9
start local 9 8: dload 7
dconst_0
invokestatic java.lang.Double.compare:(DD)I
ifeq 15
lload 9
lconst_0
lcmp
ifeq 15
9: aload 6
aload 0
getfield org.jruby.ext.thread.Mutex.lock:Ljava/util/concurrent/locks/ReentrantLock;
lload 9
invokevirtual org.jruby.RubyThread.sleep:(Ljava/util/concurrent/locks/Lock;J)V
end local 9 end local 7 end local 6 10: goto 15
StackMap locals: org.jruby.ext.thread.Mutex org.jruby.runtime.ThreadContext org.jruby.runtime.builtin.IRubyObject org.jruby.Ruby long
StackMap stack: java.lang.IllegalMonitorStateException
11: pop
12: aload 3
ldc "Attempt to unlock a mutex which is not locked"
invokevirtual org.jruby.Ruby.newThreadError:(Ljava/lang/String;)Lorg/jruby/exceptions/RaiseException;
athrow
13: StackMap locals:
StackMap stack: java.lang.InterruptedException
pop
14: aload 1
invokevirtual org.jruby.runtime.ThreadContext.pollThreadEvents:()V
15: StackMap locals:
StackMap stack:
aload 3
invokestatic java.lang.System.currentTimeMillis:()J
lload 4
lsub
ldc 1000
ldiv
invokevirtual org.jruby.Ruby.newFixnum:(J)Lorg/jruby/RubyFixnum;
areturn
end local 4 end local 3 end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 16 0 this Lorg/jruby/ext/thread/Mutex;
0 16 1 context Lorg/jruby/runtime/ThreadContext;
0 16 2 timeout Lorg/jruby/runtime/builtin/IRubyObject;
1 16 3 runtime Lorg/jruby/Ruby;
2 16 4 beg J
3 10 6 thread Lorg/jruby/RubyThread;
7 10 7 t D
8 10 9 millis J
Exception table:
from to target type
2 10 11 Class java.lang.IllegalMonitorStateException
2 10 13 Class java.lang.InterruptedException
RuntimeVisibleAnnotations:
org.jruby.anno.JRubyMethod()
MethodParameters:
Name Flags
context
timeout
public org.jruby.runtime.builtin.IRubyObject synchronize(org.jruby.runtime.ThreadContext, org.jruby.runtime.Block);
descriptor: (Lorg/jruby/runtime/ThreadContext;Lorg/jruby/runtime/Block;)Lorg/jruby/runtime/builtin/IRubyObject;
flags: (0x0001) ACC_PUBLIC
Code:
stack=2, locals=5, args_size=3
start local 0 start local 1 start local 2 0: aload 0
aload 1
invokevirtual org.jruby.ext.thread.Mutex.lock:(Lorg/jruby/runtime/ThreadContext;)Lorg/jruby/runtime/builtin/IRubyObject;
pop
1: aload 2
aload 1
invokevirtual org.jruby.runtime.Block.yieldSpecific:(Lorg/jruby/runtime/ThreadContext;)Lorg/jruby/runtime/builtin/IRubyObject;
astore 4
2: aload 0
aload 1
invokevirtual org.jruby.ext.thread.Mutex.unlock:(Lorg/jruby/runtime/ThreadContext;)Lorg/jruby/runtime/builtin/IRubyObject;
pop
3: aload 4
areturn
4: StackMap locals:
StackMap stack: java.lang.Throwable
astore 3
5: aload 0
aload 1
invokevirtual org.jruby.ext.thread.Mutex.unlock:(Lorg/jruby/runtime/ThreadContext;)Lorg/jruby/runtime/builtin/IRubyObject;
pop
6: aload 3
athrow
end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 7 0 this Lorg/jruby/ext/thread/Mutex;
0 7 1 context Lorg/jruby/runtime/ThreadContext;
0 7 2 block Lorg/jruby/runtime/Block;
Exception table:
from to target type
1 2 4 any
RuntimeVisibleAnnotations:
org.jruby.anno.JRubyMethod()
MethodParameters:
Name Flags
context
block
public org.jruby.runtime.builtin.IRubyObject owned_p(org.jruby.runtime.ThreadContext);
descriptor: (Lorg/jruby/runtime/ThreadContext;)Lorg/jruby/runtime/builtin/IRubyObject;
flags: (0x0001) ACC_PUBLIC
Code:
stack=2, locals=2, args_size=2
start local 0 start local 1 0: aload 1
getfield org.jruby.runtime.ThreadContext.runtime:Lorg/jruby/Ruby;
aload 0
getfield org.jruby.ext.thread.Mutex.lock:Ljava/util/concurrent/locks/ReentrantLock;
invokevirtual java.util.concurrent.locks.ReentrantLock.isHeldByCurrentThread:()Z
invokevirtual org.jruby.Ruby.newBoolean:(Z)Lorg/jruby/RubyBoolean;
areturn
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 1 0 this Lorg/jruby/ext/thread/Mutex;
0 1 1 context Lorg/jruby/runtime/ThreadContext;
RuntimeVisibleAnnotations:
org.jruby.anno.JRubyMethod(name = {"owned?"})
MethodParameters:
Name Flags
context
private void checkRelocking(org.jruby.runtime.ThreadContext);
descriptor: (Lorg/jruby/runtime/ThreadContext;)V
flags: (0x0002) ACC_PRIVATE
Code:
stack=2, locals=2, args_size=2
start local 0 start local 1 0: aload 0
getfield org.jruby.ext.thread.Mutex.lock:Ljava/util/concurrent/locks/ReentrantLock;
invokevirtual java.util.concurrent.locks.ReentrantLock.isHeldByCurrentThread:()Z
ifeq 2
1: aload 1
getfield org.jruby.runtime.ThreadContext.runtime:Lorg/jruby/Ruby;
ldc "Mutex relocking by same thread"
invokevirtual org.jruby.Ruby.newThreadError:(Ljava/lang/String;)Lorg/jruby/exceptions/RaiseException;
athrow
2: StackMap locals:
StackMap stack:
return
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 3 0 this Lorg/jruby/ext/thread/Mutex;
0 3 1 context Lorg/jruby/runtime/ThreadContext;
MethodParameters:
Name Flags
context
}
SourceFile: "Mutex.java"
NestMembers:
org.jruby.ext.thread.Mutex$1
InnerClasses:
org.jruby.ext.thread.Mutex$1
RuntimeVisibleAnnotations:
org.jruby.anno.JRubyClass(name = {"Mutex"})