Show / Hide Table of Contents

Class LocalCache.CacheLock

A lock object.

Inheritance
object
LocalCache.CacheLock
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
Namespace: Tangosol.Net.Cache
Assembly: Coherence.dll
Syntax
protected class LocalCache.CacheLock

Constructors

CacheLock()

Construct a new Lock object.

Declaration
protected CacheLock()

Properties

BlockCount

Gets the blocked threads count.

Declaration
protected virtual int BlockCount { get; }
Property Value
Type Description
int

The blocked threads count.

LockCount

Gets the lock count.

Declaration
protected virtual int LockCount { get; }
Property Value
Type Description
int

The lock count.

LockThread

Gets the Thread object holding this Lock.

Declaration
protected virtual Thread LockThread { get; }
Property Value
Type Description
Thread

The Thread object holding this Lock.

LockTypeDescription

Gets a human readable decription of the Lock type.

Declaration
protected virtual string LockTypeDescription { get; }
Property Value
Type Description
string

A human readable decription of the Lock type.

Methods

Assign(long)

Assign the ownership of this Lock to the calling thread.

Declaration
public virtual bool Assign(long waitMillis)
Parameters
Type Name Description
long waitMillis

The number of milliseconds to continue trying to obtain a lock; pass zero to return immediately; pass -1 to block the calling thread until the lock could be obtained.

Returns
Type Description
bool

true if lock was successful; false otherwise.

Remarks

Note: caller of this method is expected to hold a synchronization monitor for the Lock object while making this call.

Release()

Release this Lock.

Declaration
public virtual bool Release()
Returns
Type Description
bool

true if unlock is successful; false if the entry remained locked.

Remarks

Note: caller of this method is expected to hold a synchronization monitor for the Lock object while making this call.

ToString()

Return a human readable decription of the Lock.

Declaration
public override string ToString()
Returns
Type Description
string

A human readable decription of the Lock.

Overrides
object.ToString()

WaitForNotify(long)

Wait for a Lock release notification.

Declaration
public virtual long WaitForNotify(long waitMillis)
Parameters
Type Name Description
long waitMillis

The number of milliseconds to continue waiting; pass -1 to block the calling thread indefinitely.

Returns
Type Description
long

Updated wait time.

Remarks

Note: caller of this method is expected to hold a synchronization monitor for the Lock object while making this call.

In this article
Back to top Copyright © 2000, 2024, Oracle and/or its affiliates.