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