Show / Hide Table of Contents

Class AppMutex

Provides a cross-process object allowing easy detection of application instances (e.g., for use by installers and update tools). No-op on non-Windows platforms.

Inheritance
Object
AppMutex
Namespace: NanoByte.Common.Native
Assembly: NanoByte.Common.dll
Syntax
public sealed class AppMutex : Object
Remarks

Use Mutex or MutexLock instead for synchronizing access to shared resources.

Constructors

AppMutex()

Declaration
public AppMutex()

Methods

Create(String)

Creates or opens a mutex to signal that an application is running.

Declaration
public static AppMutex Create(string name)
Parameters
Type Name Description
String name

The name to be used as a mutex identifier.

Returns
Type Description
AppMutex

The handle for the mutex. Can be used to close it again. Will automatically be released once the process terminates.

Dispose()

Closes the mutex handle, allowing it to be released if no other instances are running.

Declaration
public void Dispose()

Probe(String)

Checks whether a specific mutex exists (local or global) without opening a lasting handle.

Declaration
public static bool Probe(string name)
Parameters
Type Name Description
String name

The name to be used as a mutex identifier.

Returns
Type Description
Boolean

true if an existing mutex was found; false if none existed.

Extension Methods

UpdateUtils.To<TIn, TOut>(TIn, Func<TIn, TOut>)
JsonStorage.SaveJson<T>(T, Stream)
JsonStorage.SaveJson<T>(T, String)
JsonStorage.ToJsonString<T>(T)
JsonStorage.ReparseAsJson<T>(Object)
JsonStorage.ReparseAsJson<T>(Object, T)
XmlStorage.SaveXml(Object, Stream, String)
XmlStorage.SaveXml<T>(T, String, String)
XmlStorage.ToXmlString(Object, String)
ConversionUtils.ConvertToString<TType>(TType)
In This Article
Back to top Copyright Bastian Eicher