示例#1
0
        internal byte IncrementSequenceNumber()
        {
            byte bret;

            CMonitor.Enter(_txsequenceNumberLock);
            bret = _txsequenceNumber++;
            CMonitor.Exit(_txsequenceNumberLock);
            return(bret);
        }
示例#2
0
 private void SetState()
 {
     CMonitor.Enter(lockObject);
     savedDebugLevel           = CrestronLogger.DebugLevel;
     savedLogOnlyThisLevel     = CrestronLogger.LogOnlyCurrentDebugLevel;
     savedLoggerMode           = CrestronLogger.Mode;
     CrestronLogger.DebugLevel = _debugLevel;
     CrestronLogger.LogOnlyCurrentDebugLevel = _logOnlyThisLevel;
     CrestronLogger.Mode = _loggerMode;
 }
示例#3
0
        private SocketErrorCodes SendDatagram(byte[] data, int len)
        {
            if (client == null)
            {
                return(SocketErrorCodes.SOCKET_NOT_CONNECTED);
            }

            CMonitor.Enter(_sendDatagramLock);
            SocketErrorCodes sret = client.SendData(data, len, remoteEndpoint);

            CMonitor.Exit(_sendDatagramLock);
            if (sret != SocketErrorCodes.SOCKET_OK)
            {
                ErrorLog.Error("SendDatagram: {0}", sret.ToString());
            }
            return(sret);
        }
示例#4
0
 internal void ResetSequenceNumber()
 {
     CMonitor.Enter(_txsequenceNumberLock);
     _txsequenceNumber = 0x00;
     CMonitor.Exit(_txsequenceNumberLock);
 }
示例#5
0
 internal void DecrementSingleSequenceNumber()
 {
     CMonitor.Enter(_txsequenceNumberLock);
     _txsequenceNumber--;
     CMonitor.Exit(_txsequenceNumberLock);
 }
示例#6
0
 public void Enter()
 {
     CMonitor.Enter(mutex);
 }
示例#7
0
 /// <summary>
 /// Aquire a lock and return the LockToken when the lock is aquired.
 /// </summary>
 /// <returns>LockToken object</returns>
 public LockToken AquireLock()
 {
     CMonitor.Enter(_monitorObject);
     return(new LockToken(this));
 }