Beispiel #1
0
 public void add(operation_d operation)
 {
     lock (SYNCROOT)
     {
         _operations.enqueue(operation);
     }
     _evCatnap.set();
 }
Beispiel #2
0
 public void approve()
 {
     if (_enterEv.waitForMillis(0))
     {
         _approveEv.set();
         _leaveEv.waitForever();
     }
 }
Beispiel #3
0
            /// <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();
            }
Beispiel #4
0
 public void leave()
 {
     _leaveEv.set();
 }
Beispiel #5
0
 public void enter()
 {
     _enterEv.set();
     _approveEv.waitForever();
 }