BEPUphysics.Threading.ThreadTaskManager.WaitForTaskCompletion C# (CSharp) Метод

WaitForTaskCompletion() публичный Метод

Blocks the current thread until all tasks have been completed.
public WaitForTaskCompletion ( ) : void
Результат void
        public void WaitForTaskCompletion()
        {
            //TODO: Try a WAITALL version of this
            if (Interlocked.Decrement(ref tasksRemaining) == 0)
            {
                allThreadsIdleNotifier.Set();
            }
            allThreadsIdleNotifier.WaitOne();

            //When it gets here, it means things are successfully idle'd.
            tasksRemaining = 1;
            allThreadsIdleNotifier.Reset();
        }

Usage Example

Пример #1
0
 /// <summary>
 /// Waits until all tasks enqueued using enqueueTask are complete.
 /// </summary>
 public void WaitForTaskCompletion()
 {
     taskManager.WaitForTaskCompletion();
 }