summaryrefslogtreecommitdiff
path: root/src/lib/rib.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/rib.c')
-rw-r--r--src/lib/rib.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/lib/rib.c b/src/lib/rib.c
index e0456b6f..c77eab20 100644
--- a/src/lib/rib.c
+++ b/src/lib/rib.c
@@ -778,11 +778,19 @@ static struct rib_sub * rib_get_sub(uint32_t sid)
static struct rib_sub * rib_sub_create(uint32_t sid)
{
+ pthread_condattr_t cattr;
struct rib_sub * sub = malloc(sizeof(*sub));
if (sub == NULL)
return NULL;
- if (pthread_cond_init(&sub->cond, NULL)) {
+ if (pthread_condattr_init(&cattr)) {
+ free(sub);
+ return NULL;
+ }
+#ifndef __APPLE__
+ pthread_condattr_setclock(&cattr, PTHREAD_COND_CLOCK);
+#endif
+ if (pthread_cond_init(&sub->cond, &cattr)) {
free(sub);
return NULL;
}