예제 #1
0
 public LocalInterProcessEvent(string name)
 {
     _name             = name;
     _readerWriterLock = MutextHelper.AttachToMutex(_name + "Peer2Peer.ReaderWriter");
     _me = new LocalPeer(name);
     _eventWaitersRegistry = new MemoryMappedFileChannel(_name + "Peer2Peer.Registry", MAX_BYTES);
     _eventData            = new MemoryMappedFileChannel(_name + "Peer2Peer.Data", MAX_BYTES);
 }
예제 #2
0
 public void Dispose()
 {
     if (Interlocked.Exchange(ref _disposeSignaled, 1) != 0)
     {
         return;
     }
     _me.Waiter.Set();
     _me.Dispose();
     _eventWaitersRegistry.Dispose();
     _eventData.Dispose();
     _readerWriterLock.Dispose();
     _me = null;
     _eventWaitersRegistry = null;
     _eventData            = null;
     _readerWriterLock     = null;
 }