shared_mutex (shared_timed_mutex): Only use pthread_rwlock_t when the POSIX Timeouts option is supported.

* 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
This commit is contained in:
Jonathan Wakely 2015-04-10 10:00:00 +01:00 committed by Jonathan Wakely
parent 43b0e124e4
commit c3d71b62c6
6 changed files with 11 additions and 11 deletions

View File

@ -16,6 +16,14 @@
(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.

View 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

View 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.
//

View 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.
//

View 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.
//

View 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.
//