示例#1
0
            public static ExclusiveMutex TryAcquire()
            {
                IMemoryMappedQueue queue = null;

                try
                {
                    queue = MemoryMappedQueue.Create(QueueName);
                    return(new ExclusiveMutex(queue));
                }
                catch (Exception)
                {
                    queue?.Dispose();
                    return(null);
                }
            }
示例#2
0
 public void Dispose()
 {
     _consumer.Dispose();
     _queue.Dispose();
     _isDisposed = true;
 }