Ejemplo n.º 1
0
            public static ExclusiveMutex TryAcquire()
            {
                IMemoryMappedQueue queue = null;

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