private static void PintReceiptImmediate() { while (true) { PrintWorker print = null; lock (lockObject) { if (queue.Count > 0) { try { print = (PrintWorker)queue.Dequeue(); } catch (Exception e) { Logger.Error("PrintJobQueue.cs", e.ToString()); } } } if (print != null) { print.Worker(); } else { wh.WaitOne(); // No more print jobs - wait for the signel } } }
public void PintReceipt() { lock (lockObject) { while (queue.Count > 0) { try { PrintWorker print = (PrintWorker)queue.Dequeue(); print.Worker(); } catch (Exception e) { Logger.Error("PrintJobQueue.cs", e.ToString()); } } } }