summaryrefslogtreecommitdiff
path: root/src/threads/cnd_init.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/threads/cnd_init.c')
-rw-r--r--src/threads/cnd_init.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/threads/cnd_init.c b/src/threads/cnd_init.c
index 822076e5..96fc0490 100644
--- a/src/threads/cnd_init.c
+++ b/src/threads/cnd_init.c
@@ -1,7 +1,19 @@
#include <threads.h>
#include <pthread.h>
+#include <errno.h>
int cnd_init(cnd_t *cond)
{
- return pthread_cond_init(cond, 0);
+ switch (pthread_cond_init(cond, 0)) {
+ case 0:
+ return thrd_success;
+
+ case ENOMEM:
+ return thrd_nomem;
+
+ default:
+ break;
+ }
+
+ return thrd_error;
}