Exemple #1
0
        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");
            }
        }
Exemple #2
0
 public static int WaitAny(IWaitableResult[] waitableResults, TimeSpan timeout, bool exitContext, WaitHandle cancelWaitHandle)
 {
     return(SmartThreadPool.WaitAny(waitableResults, (int)timeout.TotalMilliseconds, exitContext, cancelWaitHandle));
 }
Exemple #3
0
 public static int WaitAny(IWaitableResult[] waitableResults)
 {
     return(SmartThreadPool.WaitAny(waitableResults, -1, true));
 }
Exemple #4
0
 public static bool WaitAll(IWaitableResult[] waitableResults, TimeSpan timeout, bool exitContext)
 {
     return(SmartThreadPool.WaitAll(waitableResults, (int)timeout.TotalMilliseconds, exitContext));
 }
Exemple #5
0
 public static bool WaitAll(IWaitableResult[] waitableResults)
 {
     return(SmartThreadPool.WaitAll(waitableResults, -1, true));
 }
Exemple #6
0
 public ThreadEntry(SmartThreadPool stp)
 {
     this._associatedSmartThreadPool = stp;
     this._creationTime  = DateTime.UtcNow;
     this._lastAliveTime = DateTime.MinValue;
 }