mirror of https://github.com/quasar/Quasar.git
Use local mutex
https://docs.microsoft.com/en-us/dotnet/api/system.threading.mutex?redirectedfrom=MSDN&view=netcore-3.1#remarks
This commit is contained in:
parent
b0c54af1a0
commit
77aa6aa386
|
@ -4,7 +4,7 @@
|
|||
namespace Quasar.Client.Utilities
|
||||
{
|
||||
/// <summary>
|
||||
/// A system-wide mutex that ensures that only one instance runs at a time.
|
||||
/// A user-wide mutex that ensures that only one instance runs at a time.
|
||||
/// </summary>
|
||||
public class SingleInstanceMutex : IDisposable
|
||||
{
|
||||
|
@ -29,7 +29,7 @@ public class SingleInstanceMutex : IDisposable
|
|||
/// <param name="name">The name of the mutex.</param>
|
||||
public SingleInstanceMutex(string name)
|
||||
{
|
||||
_appMutex = new Mutex(false, name, out var createdNew);
|
||||
_appMutex = new Mutex(false, $"Local\\{name}", out var createdNew);
|
||||
CreatedNew = createdNew;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue