internal static void ValidateWorkItemsGroupWaitForIdle(IWorkItemsGroup workItemsGroup) { if (SmartThreadPool.CurrentThreadEntry == null) { return; } WorkItem currentWorkItem = SmartThreadPool.CurrentThreadEntry.CurrentWorkItem; SmartThreadPool.ValidateWorkItemsGroupWaitForIdleImpl(workItemsGroup, currentWorkItem); if (workItemsGroup != null && currentWorkItem != null && SmartThreadPool.CurrentThreadEntry.CurrentWorkItem.WasQueuedBy(workItemsGroup)) { throw new NotSupportedException("WaitForIdle cannot be called from a thread on its SmartThreadPool, it causes a deadlock"); } }
public static int WaitAny(IWaitableResult[] waitableResults, TimeSpan timeout, bool exitContext, WaitHandle cancelWaitHandle) { return(SmartThreadPool.WaitAny(waitableResults, (int)timeout.TotalMilliseconds, exitContext, cancelWaitHandle)); }
public static int WaitAny(IWaitableResult[] waitableResults) { return(SmartThreadPool.WaitAny(waitableResults, -1, true)); }
public static bool WaitAll(IWaitableResult[] waitableResults, TimeSpan timeout, bool exitContext) { return(SmartThreadPool.WaitAll(waitableResults, (int)timeout.TotalMilliseconds, exitContext)); }
public static bool WaitAll(IWaitableResult[] waitableResults) { return(SmartThreadPool.WaitAll(waitableResults, -1, true)); }
public ThreadEntry(SmartThreadPool stp) { this._associatedSmartThreadPool = stp; this._creationTime = DateTime.UtcNow; this._lastAliveTime = DateTime.MinValue; }