protected override void CleanUpResources() { try { NewMessageSignal.Set(); } finally { base.CleanUpResources(); } }
public unsafe void Write(byte[] data) { lock (DisposeLock) // If there are multiple threads, write just one message at a time { AssertSafe(); if (data.Length > Length - Offset - 8) { // Not enough space left in the shared memory buffer to write the message. WriteContinuation(data.Length); } WriteMessage(data); NewMessageSignal.Set(); // Signal reader that a message is available } }
protected override void DisposeCore() { NewMessageSignal.Set(); base.DisposeCore(); }