From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.0 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 417DC1F404; Tue, 9 Jan 2018 07:51:35 +0000 (UTC) Date: Tue, 9 Jan 2018 07:51:35 +0000 From: Eric Wong To: spew@80x24.org Subject: [PATCH] thread_pthread: remove checks for pthread_cond*_init Message-ID: <20180109075135.GA17283@whir> References: <20180109073759.7206-1-e@80x24.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20180109073759.7206-1-e@80x24.org> List-Id: These were added for NaCL support in r36022, and we dropped NaCL in r60374. IMHO, any pthreads implementation without these basic functions is not worth the time to support. --- configure.ac | 2 +- thread_pthread.c | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/configure.ac b/configure.ac index 37e50fe47d..73d83b66b1 100644 --- a/configure.ac +++ b/configure.ac @@ -2966,7 +2966,7 @@ AS_IF([test x"$enable_pthread" = xyes], [ pthread_attr_get_np pthread_attr_getstack \ pthread_get_stackaddr_np pthread_get_stacksize_np \ thr_stksegment pthread_stackseg_np pthread_getthrds_np \ - pthread_cond_init pthread_condattr_setclock pthread_condattr_init \ + pthread_condattr_setclock \ pthread_sigmask pthread_setname_np pthread_set_name_np) AS_CASE(["$target_os"],[aix*],[ac_cv_func_pthread_getattr_np=no],[AC_CHECK_FUNCS(pthread_getattr_np)]) set_current_thread_name= diff --git a/thread_pthread.c b/thread_pthread.c index 9d27ddb623..3f4310dbfb 100644 --- a/thread_pthread.c +++ b/thread_pthread.c @@ -55,7 +55,7 @@ static struct { #if defined(HAVE_PTHREAD_CONDATTR_SETCLOCK) && defined(HAVE_CLOCKID_T) && \ defined(CLOCK_REALTIME) && defined(CLOCK_MONOTONIC) && \ - defined(HAVE_CLOCK_GETTIME) && defined(HAVE_PTHREAD_CONDATTR_INIT) + defined(HAVE_CLOCK_GETTIME) #define USE_MONOTONIC_COND 1 #else #define USE_MONOTONIC_COND 0 @@ -261,7 +261,6 @@ native_mutex_destroy(pthread_mutex_t *lock) static void native_cond_initialize(rb_nativethread_cond_t *cond, int flags) { -#ifdef HAVE_PTHREAD_COND_INIT int r; # if USE_MONOTONIC_COND pthread_condattr_t attr; @@ -286,18 +285,15 @@ native_cond_initialize(rb_nativethread_cond_t *cond, int flags) } return; -#endif } static void native_cond_destroy(rb_nativethread_cond_t *cond) { -#ifdef HAVE_PTHREAD_COND_INIT int r = pthread_cond_destroy(&cond->cond); if (r != 0) { rb_bug_errno("pthread_cond_destroy", r); } -#endif } /* -- EW