public void add(operation_d operation) { lock (SYNCROOT) { _operations.enqueue(operation); } _evCatnap.set(); }
public void approve() { if (_enterEv.waitForMillis(0)) { _approveEv.set(); _leaveEv.waitForever(); } }
/// <summary> /// thread safe /// </summary> /// <param name="message"></param> public void send(byte[] message) { if (message == null) { throw new ArgumentNullException(); } if (MESSAGE_SIZE_MAX < message.Length) { return; } lock (SYNCROOT) { if (BUFF_MAX < _messages.Count) { return; } _messages.Enqueue(message); } _evDoSend.set(); }
public void leave() { _leaveEv.set(); }
public void enter() { _enterEv.set(); _approveEv.waitForever(); }