C# 클래스 SIL.Utils.GlobalMutex

This is a cross-platform, global, named mutex that can be used to synchronize access to data across processes. It supports reentrant locking. This is needed because Mono does not support system-wide, named mutexes. Mono does implement the Mutex class, but even when using the constructors with names, it only works within a single process.
상속: SIL.Utils.FwDisposableBase
파일 보기 프로젝트 열기: sillsdev/FieldWorks 1 사용 예제들

공개 메소드들

메소드 설명
GlobalMutex ( string name ) : System

Initializes a new instance of the GlobalMutex class.

Initialize ( ) : bool

Initializes this mutex.

InitializeAndLock ( ) : IDisposable

Initializes and locks this mutex. This is an atomic operation on Windows, but not Linux.

InitializeAndLock ( bool &createdNew ) : IDisposable

Initializes and locks this mutex. On Windows, this is an atomic operation, so the "createdNew" variable is guaranteed to return a correct value. On Linux, this is not an atomic operation, so "createdNew" is guaranteed to be correct only if it returns true.

Lock ( ) : IDisposable

Locks this mutex.

Unlink ( ) : bool

Unlinks or removes the mutex from the system. This only has an effect on Linux. Windows will automatically unlink the mutex. This can be called while the mutex is locked.

보호된 메소드들

메소드 설명
DisposeManagedResources ( ) : void

Disposes managed resources.

메소드 상세

DisposeManagedResources() 보호된 메소드

Disposes managed resources.
protected DisposeManagedResources ( ) : void
리턴 void

GlobalMutex() 공개 메소드

Initializes a new instance of the GlobalMutex class.
public GlobalMutex ( string name ) : System
name string
리턴 System

Initialize() 공개 메소드

Initializes this mutex.
public Initialize ( ) : bool
리턴 bool

InitializeAndLock() 공개 메소드

Initializes and locks this mutex. This is an atomic operation on Windows, but not Linux.
public InitializeAndLock ( ) : IDisposable
리턴 IDisposable

InitializeAndLock() 공개 메소드

Initializes and locks this mutex. On Windows, this is an atomic operation, so the "createdNew" variable is guaranteed to return a correct value. On Linux, this is not an atomic operation, so "createdNew" is guaranteed to be correct only if it returns true.
public InitializeAndLock ( bool &createdNew ) : IDisposable
createdNew bool
리턴 IDisposable

Lock() 공개 메소드

Locks this mutex.
public Lock ( ) : IDisposable
리턴 IDisposable

Unlink() 공개 메소드

Unlinks or removes the mutex from the system. This only has an effect on Linux. Windows will automatically unlink the mutex. This can be called while the mutex is locked.
public Unlink ( ) : bool
리턴 bool