2using System.Collections.Generic;
11 internal class MqTaskThread
13 private readonly Thread thread;
14 private readonly AutoResetEvent newItem;
15 private readonly LinkedList<MqTask> tasks =
new LinkedList<MqTask>();
16 private readonly WaitHandle[] waitHandles;
18 public MqTaskThread(ManualResetEvent Terminating)
20 this.newItem =
new AutoResetEvent(
false);
21 this.waitHandles =
new WaitHandle[] { this.newItem, Terminating };
23 this.thread =
new Thread(this.TaskExecutor)
25 Name =
"MQ Async Thread",
26 Priority = ThreadPriority.BelowNormal
32 public void Execute(MqTask Task)
36 this.tasks.AddLast(Task);
42 private void TaskExecutor()
51 switch (WaitHandle.WaitAny(
this.waitHandles, 1000))
59 if (tasks.First is
null)
63 Task = tasks.First.Value;
Static class managing the application event log. Applications and services log events on this static ...
static void Exception(Exception Exception, string Object, string Actor, string EventId, EventLevel Level, string Facility, string Module, params KeyValuePair< string, object >[] Tags)
Logs an exception. Event type will be determined by the severity of the exception.