コード例 #1
0
 // Token: 0x060002AB RID: 683 RVA: 0x00009EF0 File Offset: 0x000080F0
 public static void Reset()
 {
     lock (ManagedThreadPool._poolLock)
     {
         try
         {
             foreach (object obj in ManagedThreadPool._waitingCallbacks)
             {
                 ManagedThreadPool.WaitingCallback waitingCallback = (ManagedThreadPool.WaitingCallback)obj;
                 if (waitingCallback.State is IDisposable)
                 {
                     ((IDisposable)waitingCallback.State).Dispose();
                 }
             }
         }
         catch
         {
         }
         try
         {
             foreach (object obj2 in ManagedThreadPool._workerThreads)
             {
                 Thread thread = (Thread)obj2;
                 if (thread != null)
                 {
                     thread.Abort("reset");
                 }
             }
         }
         catch
         {
         }
         ManagedThreadPool.Initialize();
     }
 }
コード例 #2
0
 // Token: 0x060002AA RID: 682 RVA: 0x00009E98 File Offset: 0x00008098
 public static void QueueUserWorkItem(WaitCallback callback, object state)
 {
     ManagedThreadPool.WaitingCallback obj = new ManagedThreadPool.WaitingCallback(callback, state);
     lock (ManagedThreadPool._poolLock)
     {
         ManagedThreadPool._waitingCallbacks.Enqueue(obj);
     }
     ManagedThreadPool._workerThreadNeeded.AddOne();
 }
コード例 #3
0
 // Token: 0x060002AF RID: 687 RVA: 0x0000A0B8 File Offset: 0x000082B8
 private static void ProcessQueuedItems()
 {
     for (;;)
     {
         ManagedThreadPool._workerThreadNeeded.WaitOne();
         ManagedThreadPool.WaitingCallback waitingCallback = null;
         lock (ManagedThreadPool._poolLock)
         {
             if (ManagedThreadPool._waitingCallbacks.Count > 0)
             {
                 try
                 {
                     waitingCallback = (ManagedThreadPool.WaitingCallback)ManagedThreadPool._waitingCallbacks.Dequeue();
                 }
                 catch
                 {
                 }
             }
         }
         if (waitingCallback != null)
         {
             try
             {
                 Interlocked.Increment(ref ManagedThreadPool._inUseThreads);
                 waitingCallback.Callback(waitingCallback.State);
             }
             catch
             {
             }
             finally
             {
                 Interlocked.Decrement(ref ManagedThreadPool._inUseThreads);
             }
         }
     }
 }