C# 클래스 Library.DeadlockMonitor

파일 보기 프로젝트 열기: Alliance-Network/Library 1 사용 예제들

공개 메소드들

메소드 설명
Enter ( object monitor ) : void

Acquires an exclusive lock on the specified object.

Exit ( object monitor ) : void

Releases an exclusive lock on the specified object.

Lock ( object monitor ) : IDisposable

Locks the specified object and returns an IDisposable that can be used to release the lock.

TryEnter ( object monitor ) : bool

Attempts, for the specified amount of time, to acquire an exclusive lock on the specified object.

TryEnter ( object monitor, System.TimeSpan timeout ) : bool

Attempts, for the specified amount of time, to acquire an exclusive lock on the specified object.

TryEnter ( object monitor, int millisecondsTimeout ) : bool

Attempts, for the specified amount of time, to acquire an exclusive lock on the specified object.

비공개 메소드들

메소드 설명
CreateDeadlockDescription ( CycleComponentNode currentChain, Dictionary locksHeldByThreads ) : string

Creates a textual description of the deadlock.

CreateThreadAndLockTables ( Dictionary &locksHeldByThreads, Dictionary &threadsWaitingOnLocks ) : void

Generates mapping tables based on the data in _monitorStates.

ThrowIfDeadlockDetected ( MonitorState targetMs ) : void

Throws an exception if a deadlock would be caused by the current thread waiting on the specified lock.

메소드 상세

Enter() 공개 정적인 메소드

Acquires an exclusive lock on the specified object.
public static Enter ( object monitor ) : void
monitor object The object on which to acquire the monitor lock.
리턴 void

Exit() 공개 정적인 메소드

Releases an exclusive lock on the specified object.
public static Exit ( object monitor ) : void
monitor object Releases an exclusive lock on the specified object.
리턴 void

Lock() 공개 정적인 메소드

Locks the specified object and returns an IDisposable that can be used to release the lock.
public static Lock ( object monitor ) : IDisposable
monitor object The object on which to acquire the monitor lock.
리턴 IDisposable

TryEnter() 공개 정적인 메소드

Attempts, for the specified amount of time, to acquire an exclusive lock on the specified object.
public static TryEnter ( object monitor ) : bool
monitor object The object on which to acquire the lock.
리턴 bool

TryEnter() 공개 정적인 메소드

Attempts, for the specified amount of time, to acquire an exclusive lock on the specified object.
public static TryEnter ( object monitor, System.TimeSpan timeout ) : bool
monitor object The object on which to acquire the lock.
timeout System.TimeSpan A TimeSpan representing the amount of time to wait for the lock. A value of -1 millisecond specifies an infinite wait.
리턴 bool

TryEnter() 공개 정적인 메소드

Attempts, for the specified amount of time, to acquire an exclusive lock on the specified object.
public static TryEnter ( object monitor, int millisecondsTimeout ) : bool
monitor object The object on which to acquire the lock.
millisecondsTimeout int The number of milliseconds to wait for the lock.
리턴 bool