MCPcopy Create free account
hub / github.com/carbonengine/trinity / AquireSemaphore

Method AquireSemaphore

shadercompiler/WorkQueue.h:201–223  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

199
200private:
201 void AquireSemaphore()
202 {
203#ifdef __APPLE__
204 auto waitResult = semaphore_wait( m_activeWorkersSemaphore );
205 if( waitResult != KERN_SUCCESS )
206 {
207 g_messages.AddMessage( "WorkQueue2: Waiting on m_activeWorkersSemaphore failed! Error: %d", waitResult );
208 }
209#else
210 DWORD waitResult = WaitForSingleObject( m_activeWorkersSemaphore, INFINITE );
211 if( waitResult != WAIT_OBJECT_0 )
212 {
213 if( waitResult == WAIT_FAILED )
214 {
215 g_messages.AddMessage( "WorkQueue2: Waiting on m_activeWorkersSemaphore failed! Error: %d %d", waitResult, GetLastError() );
216 }
217 else
218 {
219 g_messages.AddMessage( "WorkQueue2: Waiting on m_activeWorkersSemaphore failed! Error: %d", waitResult );
220 }
221 }
222#endif
223 }
224
225 void FreeSemaphore()
226 {

Callers

nothing calls this directly

Calls 1

AddMessageMethod · 0.80

Tested by

no test coverage detected