Пример #1
0
 void removeThread(Thread *pthread)
 {
     Mutex::Locker lock(&ThreadMutex);
     ThreadSet.Remove(pthread);
     if (ThreadSet.GetSize() == 0)
         ThreadsEmpty.Notify();
 }
Пример #2
0
    void finishAllThreads()
    {
        // Only original root thread can call this.
        OVR_ASSERT(pthread_self() == RootThreadId);

        Mutex::Locker lock(&ThreadMutex);
        while (ThreadSet.GetSize() != 0)
            ThreadsEmpty.Wait(&ThreadMutex);
    }