summaryrefslogtreecommitdiff
path: root/thread_pthread.c
diff options
context:
space:
mode:
Diffstat (limited to 'thread_pthread.c')
-rw-r--r--thread_pthread.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/thread_pthread.c b/thread_pthread.c
index 61b93e1edf..05a6af2a45 100644
--- a/thread_pthread.c
+++ b/thread_pthread.c
@@ -245,6 +245,7 @@ int pthread_condattr_init(pthread_condattr_t *attr);
static void
native_cond_initialize(rb_thread_cond_t *cond, int flags)
{
+#ifdef HAVE_PTHREAD_COND_INITIALIZE
int r;
pthread_condattr_t attr;
@@ -266,15 +267,18 @@ native_cond_initialize(rb_thread_cond_t *cond, int flags)
}
return;
- }
+#endif
+}
static void
native_cond_destroy(rb_thread_cond_t *cond)
{
+#ifdef HAVE_PTHREAD_COND_INITIALIZE
int r = pthread_cond_destroy(&cond->cond);
if (r != 0) {
rb_bug_errno("pthread_cond_destroy", r);
}
+#endif
}
#endif