Exemple #1
0
 internal void Queue(IEventInvocation eventInvocation)
 {
     try
     {
         spinLock.Lock();
         waitingEvents.Enqueue(eventInvocation);
     }
     finally
     {
         spinLock.Unlock();
     }
 }
Exemple #2
0
 public void Recycle()
 {
     Data = default(Data);
     try
     {
         spinLock.Lock();
         pool.Enqueue(this);
     }
     finally
     {
         spinLock.Unlock();
     }
 }
Exemple #3
0
 private static void SpinLockFunc()
 {
     for (int i = 0; i < 100000; i++)
     {
         spinLocker.Lock();
         SpinLockCount++;
         spinLocker.Unlock();
     }
 }
Exemple #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);
 }