internal static void ExecuteTask(MqTask Item) { if (terminated) { return; } MqTaskThread T; lock (threads) { if (threads.First is null) { T = null; } else { T = threads.First.Value; threads.RemoveFirst(); } } if (T is null) { T = new MqTaskThread(terminating); } T.Execute(Item); }
public void Execute(MqTask Task) { lock (tasks) { this.tasks.AddLast(Task); } this.newItem.Set(); }