C# Class EpLibrary.cs.MutexEx

A class that handles the mutex functionality
Inheritance: BaseLock, IDisposable
显示文件 Open project: juhgiyo/EpLibrary.cs Class Usage Examples

Private Properties

Property Type Description

Public Methods

Method Description
Dispose ( ) : void
IsMutexAbandoned ( ) : bool

Returns the flag whether this mutex is abandoned or not.

Lock ( ) : bool

Locks the critical section

MutexEx ( MutexEx b ) : System

Default copy constructor

MutexEx ( String mutexName = null ) : System

Default constructor

MutexEx ( bool isInitialOwned, String mutexName = null ) : System

Default Constructor

TryLock ( ) : bool

Try to lock the critical section If other thread is already in the critical section, it just returns false and continue, otherwise obtain the ciritical section

TryLockFor ( int dwMilliSecond ) : bool

Try to lock the critical section for given time

Unlock ( ) : void

Leave the critical section

Protected Methods

Method Description
Dispose ( bool isDisposing ) : void

Method Details

Dispose() public method

public Dispose ( ) : void
return void

Dispose() protected method

protected Dispose ( bool isDisposing ) : void
isDisposing bool
return void

IsMutexAbandoned() public method

Returns the flag whether this mutex is abandoned or not.
public IsMutexAbandoned ( ) : bool
return bool

Lock() public method

Locks the critical section
public Lock ( ) : bool
return bool

MutexEx() public method

Default copy constructor
public MutexEx ( MutexEx b ) : System
b MutexEx the object to copy from
return System

MutexEx() public method

Default constructor
public MutexEx ( String mutexName = null ) : System
mutexName String name of the mutex
return System

MutexEx() public method

Default Constructor
public MutexEx ( bool isInitialOwned, String mutexName = null ) : System
isInitialOwned bool flag to own the mutex on creation
mutexName String name of the mutex
return System

TryLock() public method

Try to lock the critical section If other thread is already in the critical section, it just returns false and continue, otherwise obtain the ciritical section
public TryLock ( ) : bool
return bool

TryLockFor() public method

Try to lock the critical section for given time
public TryLockFor ( int dwMilliSecond ) : bool
dwMilliSecond int the wait time
return bool

Unlock() public method

Leave the critical section
public Unlock ( ) : void
return void