Table of Contents

Class LockObject

Namespace
CMS.Base
Assembly
CMS.Base.dll

Locking object

public class LockObject
Inheritance
object
LockObject
Extension Methods

Constructors

LockObject(string)

Constructor

public LockObject(string key = null)

Parameters

key string

Properties

Data

Read data

protected object Data { get; set; }

Property Value

object

Exception

Exception that occurred within data reading

public Exception Exception { get; set; }

Property Value

Exception

Key

Lock object key

public string Key { get; protected set; }

Property Value

string

ReadFailed

Flag indicating that the read failed

public bool ReadFailed { get; protected set; }

Property Value

bool

Methods

EnterRead<OutputType>(ref OutputType)

Attempts to enter read lock. Returns true if the lock was acquired

public bool EnterRead<OutputType>(ref OutputType output)

Parameters

output OutputType

Returns the read data in case other thread is reading. Waits until the other reading finishes before returning the data.

Returns

bool

Type Parameters

OutputType

FinishReadFailed()

Finishes the read operation with failure

public void FinishReadFailed()

FinishRead<OutputType>(OutputType)

Finishes the read operation

public void FinishRead<OutputType>(OutputType output)

Parameters

output OutputType

Output type

Type Parameters

OutputType