// Called with Task.WaitAll(someTasks) or Task.WaitAny(someTasks) so that we can remove ourselves // also when our wait condition is ok public void ParticipateUntilInternal(Task self, ManualResetEventSlim evt, int millisecondsTimeout) { if (millisecondsTimeout == -1) { millisecondsTimeout = int.MaxValue; } ThreadWorker.WorkerMethod(self, evt, millisecondsTimeout, workQueue, workers, pulseHandle); }
// Called with Task.WaitAll(someTasks) or Task.WaitAny(someTasks) so that we can remove ourselves // also when our wait condition is ok public void ParticipateUntil(Func <bool> predicate) { ThreadWorker.WorkerMethod(predicate, workQueue, workers); }