shared_mutex (shared_timed_mutex): Only use pthread_rwlock_t when the POSIX Timeouts...
authorJonathan Wakely <jwakely@redhat.com>
Fri, 10 Apr 2015 09:00:00 +0000 (10:00 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Fri, 10 Apr 2015 09:00:00 +0000 (10:00 +0100)
* include/std/shared_mutex (shared_timed_mutex): Only use
pthread_rwlock_t when the POSIX Timeouts option is supported.
* testsuite/30_threads/shared_lock/cons/5.cc: Remove
dg-require-gthreads-timed.
* testsuite/30_threads/shared_lock/cons/6.cc: Likewise.
* testsuite/30_threads/shared_lock/locking/3.cc: Likewise.
* testsuite/30_threads/shared_lock/locking/4.cc: Likewise.

From-SVN: r221971

libstdc++-v3/ChangeLog
libstdc++-v3/include/std/shared_mutex
libstdc++-v3/testsuite/30_threads/shared_lock/cons/5.cc
libstdc++-v3/testsuite/30_threads/shared_lock/cons/6.cc
libstdc++-v3/testsuite/30_threads/shared_lock/locking/3.cc
libstdc++-v3/testsuite/30_threads/shared_lock/locking/4.cc

index e4ca68dee854ab26d3a5d33452f88f4c54dcb47f..c0307d239893702b8ed68b626f59b955d8ead0b6 100644 (file)
        (unlock_shared): Add Debug Mode assertion.
        * testsuite/30_threads/shared_timed_mutex/try_lock/3.cc: New.
 
+       * include/std/shared_mutex (shared_timed_mutex): Only use
+       pthread_rwlock_t when the POSIX Timeouts option is supported.
+       * testsuite/30_threads/shared_lock/cons/5.cc: Remove
+       dg-require-gthreads-timed.
+       * testsuite/30_threads/shared_lock/cons/6.cc: Likewise.
+       * testsuite/30_threads/shared_lock/locking/3.cc: Likewise.
+       * testsuite/30_threads/shared_lock/locking/4.cc: Likewise.
+
 2015-04-09  H.J. Lu  <hongjiu.lu@intel.com>
 
        * config/abi/post/x86_64-linux-gnu/x32/baseline_symbols.txt: Update.
index 7f26465788b19dbecd2f5cf92e4493c32fdeccda..b72a822a57b9e9443c641279f422c6d3f64b2781 100644 (file)
@@ -57,7 +57,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   /// shared_timed_mutex
   class shared_timed_mutex
   {
-#ifdef _GLIBCXX_USE_PTHREAD_RWLOCK_T
+#if _GLIBCXX_USE_PTHREAD_RWLOCK_T && _GTHREAD_USE_MUTEX_TIMEDLOCK
     typedef chrono::system_clock       __clock_t;
 
 #ifdef PTHREAD_RWLOCK_INITIALIZER
@@ -116,7 +116,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       return true;
     }
 
-#if _GTHREAD_USE_MUTEX_TIMEDLOCK
     template<typename _Rep, typename _Period>
       bool
       try_lock_for(const chrono::duration<_Rep, _Period>& __rel_time)
@@ -158,7 +157,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
        const auto __s_atime = __s_entry + __delta;
        return try_lock_until(__s_atime);
       }
-#endif
 
     void
     unlock()
@@ -200,7 +198,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       return true;
     }
 
-#if _GTHREAD_USE_MUTEX_TIMEDLOCK
     template<typename _Rep, typename _Period>
       bool
       try_lock_shared_for(const chrono::duration<_Rep, _Period>& __rel_time)
@@ -258,7 +255,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
        const auto __s_atime = __s_entry + __delta;
        return try_lock_shared_until(__s_atime);
       }
-#endif
 
     void
     unlock_shared()
@@ -266,7 +262,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       unlock();
     }
 
-#else // ! _GLIBCXX_USE_PTHREAD_RWLOCK_T
+#else // ! (_GLIBCXX_USE_PTHREAD_RWLOCK_T && _GTHREAD_USE_MUTEX_TIMEDLOCK)
 
     // Must use the same clock as condition_variable
     typedef chrono::system_clock       __clock_t;
@@ -459,7 +455,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
            _M_gate1.notify_one();
        }
     }
-#endif // ! _GLIBCXX_USE_PTHREAD_RWLOCK_T
+#endif // _GLIBCXX_USE_PTHREAD_RWLOCK_T && _GTHREAD_USE_MUTEX_TIMEDLOCK
   };
 #endif // _GLIBCXX_HAS_GTHREADS
 
index 63ab5149a73e6dfcc0538d6d9e15b20882d49c3a..9ec0498620ae462918550b49b8d8832e01b15445 100644 (file)
@@ -3,7 +3,6 @@
 // { dg-options " -std=gnu++14 -pthreads" { target *-*-solaris* } }
 // { dg-options " -std=gnu++14 " { target *-*-cygwin *-*-darwin* } }
 // { dg-require-cstdint "" }
-// { dg-require-gthreads-timed "" }
 
 // Copyright (C) 2013-2015 Free Software Foundation, Inc.
 //
index 8b2bcd5e4927f71b39b77df19ab74f0b40101257..2074bbefd489899df79711d3f7260513e1c4e6b8 100644 (file)
@@ -3,7 +3,6 @@
 // { dg-options " -std=gnu++14 -pthreads" { target *-*-solaris* } }
 // { dg-options " -std=gnu++14 " { target *-*-cygwin *-*-darwin* } }
 // { dg-require-cstdint "" }
-// { dg-require-gthreads-timed "" }
 
 // Copyright (C) 2013-2015 Free Software Foundation, Inc.
 //
index b67022a0f42e3376d017e6a72244a5c0a6d02022..4b653eafe43b9687dd56e6e03a0c1c50ec79686b 100644 (file)
@@ -3,7 +3,6 @@
 // { dg-options " -std=gnu++14 -pthreads" { target *-*-solaris* } }
 // { dg-options " -std=gnu++14 " { target *-*-cygwin *-*-darwin* } }
 // { dg-require-cstdint "" }
-// { dg-require-gthreads-timed "" }
 
 // Copyright (C) 2013-2015 Free Software Foundation, Inc.
 //
index e87d0dd73a157b9a7a31025c1cc856170680f63e..afeefa2aca08345673d36a4b1d0ba766948228ae 100644 (file)
@@ -3,7 +3,6 @@
 // { dg-options " -std=gnu++14 -pthreads" { target *-*-solaris* } }
 // { dg-options " -std=gnu++14 " { target *-*-cygwin *-*-darwin* } }
 // { dg-require-cstdint "" }
-// { dg-require-gthreads-timed "" }
 
 // Copyright (C) 2013-2015 Free Software Foundation, Inc.
 //