コード例 #1
0
 public void WorkerThread()
 {
     while (isRunning)
     {
         if (statements.Count > 0)
         {
             DatabaseAction action = null;
             if (statements.Dequeue(out action))
             {
                 action.Action.Invoke();
             }
             else
             {
                 Thread.Sleep(10);
             }
         }
         else
         {
             Thread.Sleep(10);
         }
     }
 }
コード例 #2
0
 public void AddAction(DatabaseAction action)
 {
     statements.Enqueue(action);
 }