Top Description Fields Constructors Methods
org.jruby.ext.thread

public Class Mutex

extends RubyObject
implements DataType
Class Inheritance
All Implemented Interfaces
org.jruby.runtime.marshal.DataType
Annotations
@JRubyClass
name:Mutex
Imports
java.util.concurrent.locks.ReentrantLock, org.jruby.Ruby, .RubyBoolean, .RubyClass, .RubyObject, .RubyThread, .RubyTime, org.jruby.anno.JRubyClass, .JRubyMethod, org.jruby.runtime.Block, .Helpers, .ThreadContext, org.jruby.runtime.builtin.IRubyObject, org.jruby.runtime.marshal.DataType

The "Mutex" class from the 'thread' library.

Field Summary

Modifier and TypeField and Description
pack-priv final ReentrantLock
pack-priv volatile RubyThread
lockingThread

The non-fiber thread that currently holds the lock; this will be the same for all fibers associated with that thread.

Inherited from org.jruby.RubyObject:
IVAR_INSPECTING_OBJECT_ALLOCATOROBJECT_ALLOCATORREIFYING_OBJECT_ALLOCATOR

Constructor Summary

AccessConstructor and Description
public
Mutex(Ruby runtime, RubyClass type)

Method Summary

Modifier and TypeMethod and Description
private void
public boolean
public IRubyObject
public RubyBoolean
public static Mutex
newInstance(ThreadContext context, IRubyObject recv, IRubyObject[] args, Block block)

public IRubyObject
public static RubyClass
setup(ThreadContext context, RubyClass Thread, RubyClass Object)

public IRubyObject
public IRubyObject
sleep(ThreadContext context, IRubyObject timeout)

public IRubyObject
public RubyBoolean
public boolean
public IRubyObject
Inherited from org.jruby.RubyObject:
attachToObjectSpacecallInitcallInitcallInitcallInitcallInitcallInitcallInitcallInitcallInitcallInitconvertToTypedigdig1dig2eqlInternalequalInternalequalsfinishObjectClassgetNativeClassIndexhashCodeinspectop_eqqputsspecificEvaltoRubyStringtoString

Field Detail

lockback to summary
pack-priv final ReentrantLock lock
lockingThreadback to summary
pack-priv volatile RubyThread lockingThread

The non-fiber thread that currently holds the lock; this will be the same for all fibers associated with that thread.

Constructor Detail

Mutexback to summary
public Mutex(Ruby runtime, RubyClass type)

Method Detail

checkRelockingback to summary
private void checkRelocking(ThreadContext context)
isLockedback to summary
public boolean isLocked()
lockback to summary
public IRubyObject lock(ThreadContext context)
Annotations
@JRubyMethod
locked_pback to summary
public RubyBoolean locked_p(ThreadContext context)
Annotations
@JRubyMethod
name:locked?
newInstanceback to summary
public static Mutex newInstance(ThreadContext context, IRubyObject recv, IRubyObject[] args, Block block)
Annotations
@JRubyMethod
name:new
rest:true
meta:true
owned_pback to summary
public IRubyObject owned_p(ThreadContext context)
Annotations
@JRubyMethod
name:owned?
setupback to summary
public static RubyClass setup(ThreadContext context, RubyClass Thread, RubyClass Object)
sleepback to summary
public IRubyObject sleep(ThreadContext context)
Annotations
@JRubyMethod
sleepback to summary
public IRubyObject sleep(ThreadContext context, IRubyObject timeout)
Annotations
@JRubyMethod
synchronizeback to summary
public IRubyObject synchronize(ThreadContext context, Block block)
Annotations
@JRubyMethod
try_lockback to summary
public RubyBoolean try_lock(ThreadContext context)
Annotations
@JRubyMethod
tryLockback to summary
public boolean tryLock(ThreadContext context)
unlockback to summary
public IRubyObject unlock(ThreadContext context)
Annotations
@JRubyMethod