Exemplo n.º 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);
         }
     }
 }
Exemplo n.º 2
0
 public void AddAction(DatabaseAction action)
 {
     statements.Enqueue(action);
 }