示例#1
0
 internal void Queue(IEventInvocation eventInvocation)
 {
     try
     {
         spinLock.Lock();
         waitingEvents.Enqueue(eventInvocation);
     }
     finally
     {
         spinLock.Unlock();
     }
 }
示例#2
0
 public void Recycle()
 {
     Data = default(Data);
     try
     {
         spinLock.Lock();
         pool.Enqueue(this);
     }
     finally
     {
         spinLock.Unlock();
     }
 }
示例#3
0
 private static void SpinLockFunc()
 {
     for (int i = 0; i < 100000; i++)
     {
         spinLocker.Lock();
         SpinLockCount++;
         spinLocker.Unlock();
     }
 }
示例#4
0
 public static byte *ReadLine(byte *output, int length)
 {
     mutex.Lock();
     max      = length;
     position = 0;
     input    = output;
     while (max != -1)
     {
     }
     max      = -1;
     position = 0;
     input    = null;
     mutex.Unlock();
     return(null);
 }