MCPcopy Create free account
hub / github.com/crownengine/crown / post

Method post

src/core/thread/semaphore.cpp:69–86  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

67}
68
69void Semaphore::post(u32 count)
70{
71#if CROWN_PLATFORM_WINDOWS
72 BOOL err = ReleaseSemaphore(_priv->handle, count, NULL);
73 CE_ASSERT(err != 0, "ReleaseSemaphore: GetLastError = %d", GetLastError());
74 CE_UNUSED(err);
75#else
76 pthread_mutex_lock(&_priv->mutex);
77 for (u32 i = 0; i < count; ++i) {
78 int err = pthread_cond_signal(&_priv->cond);
79 CE_ASSERT(err == 0, "pthread_cond_signal: errno = %d", err);
80 CE_UNUSED(err);
81 }
82
83 _priv->count += count;
84 pthread_mutex_unlock(&_priv->mutex);
85#endif
86}
87
88void Semaphore::wait()
89{

Callers 4

thread_procFunction · 0.45
shutdownMethod · 0.45
run_input_threadMethod · 0.45

Calls 2

pthread_mutex_lockFunction · 0.85
pthread_mutex_unlockFunction · 0.85

Tested by

no test coverage detected