MCPcopy Create free account
hub / github.com/VirtualGL/virtualgl / wait

Method wait

util/Mutex.cpp:61–86  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

59
60
61void Event::wait(void)
62{
63 #ifdef _WIN32
64
65 if(WaitForSingleObject(event, INFINITE) == WAIT_FAILED)
66 throw(W32Error("Event::wait()"));
67
68 #else
69
70 int ret;
71 if((ret = pthread_mutex_lock(&mutex)) != 0)
72 throw(Error("Event::wait()", strerror(ret)));
73 while(!ready && !deadYet)
74 {
75 if((ret = pthread_cond_wait(&cond, &mutex)) != 0)
76 {
77 pthread_mutex_unlock(&mutex);
78 throw(Error("Event::wait()", strerror(ret)));
79 }
80 }
81 ready = false;
82 if((ret = pthread_mutex_unlock(&mutex)) != 0)
83 throw(Error("Event::wait()", strerror(ret)));
84
85 #endif
86}
87
88
89void Event::signal(void)

Callers 6

waitUntilReadyMethod · 0.45
waitUntilCompleteMethod · 0.45
FrameMethod · 0.45
getMethod · 0.45
runMethod · 0.45
mainFunction · 0.45

Calls 3

W32ErrorClass · 0.85
UnixErrorClass · 0.85
ErrorClass · 0.50

Tested by 2

runMethod · 0.36
mainFunction · 0.36