diff options
author | redi <redi@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-11-23 22:11:23 +0000 |
---|---|---|
committer | redi <redi@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-11-23 22:11:23 +0000 |
commit | a2bb721d8e1a576841fb80f1c78f0694014d4e8b (patch) | |
tree | bd11ed625b040c97f7b7dc87865300f4d68dbf00 /libstdc++-v3/testsuite/lib | |
parent | 66ee291faa52558caedbc214d662b7b7742eca7e (diff) | |
download | gcc-a2bb721d8e1a576841fb80f1c78f0694014d4e8b.tar.gz |
PR libstdc++/52680
* acinclude.m4 (GLIBCXX_ENABLE_LIBSTDCXX_TIME): Check for usleep and
sleep if nanosleep is not available. Bump libtool revision.
* config.h.in: Regenerate.
* configure: Likewise.
* config/abi/pre/gnu.ver (GLIBCXX_3.4.18): Add __sleep_for.
* include/std/thread (this_thread::__sleep_for): Add.
(this_thread::yield, this_thread::sleep_until, this_thread::sleep_for):
Declare unconditionally.
* src/c++11/thread.cc (this_thread::__sleep_for): Define.
* testsuite/lib/libstdc++.exp (check_v3_target_nanosleep): Rename to
check_v3_target_sleep.
* testsuite/lib/dg-options.exp (dg-require-nanosleep): Rename to
dg-require-sleep.
* testsuite/30_threads/condition_variable_any/53830.cc: Update.
* testsuite/30_threads/this_thread/2.cc: Likewise.
* testsuite/30_threads/this_thread/3.cc: Likewise.
* testsuite/30_threads/this_thread/4.cc: Likewise.
* testsuite/30_threads/async/54297.cc: Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@193769 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/testsuite/lib')
-rw-r--r-- | libstdc++-v3/testsuite/lib/dg-options.exp | 4 | ||||
-rw-r--r-- | libstdc++-v3/testsuite/lib/libstdc++.exp | 44 |
2 files changed, 25 insertions, 23 deletions
diff --git a/libstdc++-v3/testsuite/lib/dg-options.exp b/libstdc++-v3/testsuite/lib/dg-options.exp index 14c705a28c0..6836fbce711 100644 --- a/libstdc++-v3/testsuite/lib/dg-options.exp +++ b/libstdc++-v3/testsuite/lib/dg-options.exp @@ -143,8 +143,8 @@ proc dg-require-gthreads-timed { args } { return } -proc dg-require-nanosleep { args } { - if { ![ check_v3_target_nanosleep ] } { +proc dg-require-sleep { args } { + if { ![ check_v3_target_sleep ] } { upvar dg-do-what dg-do-what set dg-do-what [list [lindex ${dg-do-what} 0] "N" "P"] return diff --git a/libstdc++-v3/testsuite/lib/libstdc++.exp b/libstdc++-v3/testsuite/lib/libstdc++.exp index 09f512b3e9f..adb9c157586 100644 --- a/libstdc++-v3/testsuite/lib/libstdc++.exp +++ b/libstdc++-v3/testsuite/lib/libstdc++.exp @@ -1352,41 +1352,43 @@ proc check_v3_target_gthreads_timed { } { } -proc check_v3_target_nanosleep { } { +proc check_v3_target_sleep { } { global cxxflags global DEFAULT_CXXFLAGS - global et_nanosleep + global et_sleep global tool - if { ![info exists et_nanosleep_target_name] } { - set et_nanosleep_target_name "" + if { ![info exists et_sleep_target_name] } { + set et_sleep_target_name "" } # If the target has changed since we set the cached value, clear it. set current_target [current_target_name] - if { $current_target != $et_nanosleep_target_name } { - verbose "check_v3_target_nanosleep: `$et_nanosleep_target_name'" 2 - set et_nanosleep_target_name $current_target - if [info exists et_nanosleep] { - verbose "check_v3_target_nanosleep: removing cached result" 2 - unset et_nanosleep + if { $current_target != $et_sleep_target_name } { + verbose "check_v3_target_sleep: `$et_sleep_target_name'" 2 + set et_sleep_target_name $current_target + if [info exists et_sleep] { + verbose "check_v3_target_sleep: removing cached result" 2 + unset et_sleep } } - if [info exists et_nanosleep] { - verbose "check_v3_target_nanosleep: using cached result" 2 + if [info exists et_sleep] { + verbose "check_v3_target_sleep: using cached result" 2 } else { - set et_nanosleep 0 + set et_sleep 0 - # Set up and preprocess a C++0x test program that depends - # on the nanosleep facilities to be available. - set src nanosleep[pid].cc + # Set up and preprocess a C++11 test program that depends + # on the sleep facilities to be available. + set src sleep[pid].cc set f [open $src "w"] puts $f "#include <bits/c++config.h>" puts $f "#ifndef _GLIBCXX_USE_NANOSLEEP" - puts $f "# error No nanosleep" + puts $f "# ifndef _GLIBCXX_HAVE_SLEEP" + puts $f "# error No nanosleep or sleep" + puts $f "# endif" puts $f "#endif" close $f @@ -1399,13 +1401,13 @@ proc check_v3_target_nanosleep { } { if [string match "" $lines] { # No error message, preprocessing succeeded. - set et_nanosleep 1 + set et_sleep 1 } else { - verbose "check_v3_target_nanosleep: compilation failed" 2 + verbose "check_v3_target_sleep: compilation failed" 2 } } - verbose "check_v3_target_nanosleep: $et_nanosleep" 2 - return $et_nanosleep + verbose "check_v3_target_sleep: $et_sleep" 2 + return $et_sleep } proc check_v3_target_sched_yield { } { |