/// <summary> /// Queue a work item to be called by a background thread /// </summary> /// <param name="waitCallback">WaitCallback delegate to be invoked</param> /// <param name="parameters">Array of objects to pass as parameters</param> internal static void QueueUserWorkItem(RtpEvents.RaiseEvent del, object[] parameters) { syncWorkItems.Enqueue(new WorkItem(del, parameters)); if (peakQueueLength < syncWorkItems.Count) { peakQueueLength = syncWorkItems.Count; } newWorkItem.Set(); }
public WorkItem(RtpEvents.RaiseEvent method, object[] parameters) { this.method = method; this.parameters = parameters; }