]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
condition_variable: Revert inadvertent changes.
authorPaolo Carlini <paolo@gcc.gnu.org>
Fri, 18 Dec 2009 09:44:54 +0000 (09:44 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Fri, 18 Dec 2009 09:44:54 +0000 (09:44 +0000)
2009-12-18  Paolo Carlini  <paolo.carlini@oracle.com>

* include/std/condition_variable: Revert inadvertent changes.
* testsuite/30_threads/condition_variable/cons/assign_neg.cc: Ditto.
* testsuite/30_threads/condition_variable/cons/copy_neg.cc: Ditto.
* testsuite/30_threads/condition_variable/members/1.cc: Ditto.
* testsuite/30_threads/condition_variable/members/2.cc: Ditto.
* testsuite/30_threads/condition_variable_any/cons/assign_neg.cc: Ditto.
* testsuite/30_threads/condition_variable_any/cons/copy_neg.cc: Ditto.

From-SVN: r155343

libstdc++-v3/include/std/condition_variable
libstdc++-v3/testsuite/30_threads/condition_variable/cons/assign_neg.cc
libstdc++-v3/testsuite/30_threads/condition_variable/cons/copy_neg.cc
libstdc++-v3/testsuite/30_threads/condition_variable/members/1.cc
libstdc++-v3/testsuite/30_threads/condition_variable/members/2.cc
libstdc++-v3/testsuite/30_threads/condition_variable_any/cons/assign_neg.cc
libstdc++-v3/testsuite/30_threads/condition_variable_any/cons/copy_neg.cc

index f5e4db15c2a215be352d40b1fe92b1f593b385c4..f87eb1b8d1a05be8588c93632583a59a0a782309 100644 (file)
@@ -50,9 +50,6 @@ namespace std
    * @{
    */
 
-  /// cv_status
-  enum class cv_status { no_timeout, timeout };
-  
   /// condition_variable
   class condition_variable
   {
@@ -87,13 +84,13 @@ namespace std
       }
 
     template<typename _Duration>
-      cv_status
+      bool
       wait_until(unique_lock<mutex>& __lock,
                 const chrono::time_point<__clock_t, _Duration>& __atime)
       { return __wait_until_impl(__lock, __atime); }
 
     template<typename _Clock, typename _Duration>
-      cv_status
+      bool
       wait_until(unique_lock<mutex>& __lock,
                 const chrono::time_point<_Clock, _Duration>& __atime)
       {
@@ -113,14 +110,14 @@ namespace std
                 _Predicate __p)
       {
        while (!__p())
-         if (wait_until(__lock, __atime) == cv_status::timeout)
+         if (!wait_until(__lock, __atime))
            return __p();
 
        return true;
       }
 
     template<typename _Rep, typename _Period>
-      cv_status
+      bool
       wait_for(unique_lock<mutex>& __lock,
               const chrono::duration<_Rep, _Period>& __rtime)
       { return wait_until(__lock, __clock_t::now() + __rtime); }
@@ -138,7 +135,7 @@ namespace std
 
   private:
     template<typename _Clock, typename _Duration>
-      cv_status
+      bool
       __wait_until_impl(unique_lock<mutex>& __lock,
                        const chrono::time_point<_Clock, _Duration>& __atime)
       {
@@ -157,8 +154,7 @@ namespace std
        __gthread_cond_timedwait(&_M_cond, __lock.mutex()->native_handle(),
                                 &__ts);
 
-       return (_Clock::now() < __atime
-               ? cv_status::no_timeout : cv_status::timeout);
+       return _Clock::now() < __atime;
       }
   };
 
@@ -193,7 +189,7 @@ namespace std
       wait(_Lock& __lock, _Predicate __p);
 
     template<typename _Lock, typename _Clock, typename _Duration>
-      cv_status
+      bool
       wait_until(_Lock& __lock,
                 const chrono::time_point<_Clock, _Duration>& __atime);
 
@@ -205,7 +201,7 @@ namespace std
                 _Predicate __p);
 
     template<typename _Lock, typename _Rep, typename _Period>
-      cv_status
+      bool
       wait_for(_Lock& __lock, const chrono::duration<_Rep, _Period>& __rtime);
 
     template<typename _Lock, typename _Rep,
index 9e9ad8a7b03c94042aa577374c99d252d9db1bca..04e492b3f43b2f02c72a3cb5f4d264d86152e696 100644 (file)
@@ -32,4 +32,4 @@ void test01()
 }
 
 // { dg-error "used here" "" { target *-*-* } 31 }
-// { dg-error "deleted function" "" { target *-*-* } 70 }
+// { dg-error "deleted function" "" { target *-*-* } 67 }
index 5765351554e1bcdf40147698ebde6f25aa82882d..0d066282f1f3abd20a5091afc036dba0ae110dea 100644 (file)
@@ -31,4 +31,4 @@ void test01()
 }
 
 // { dg-error "used here" "" { target *-*-* } 30 }
-// { dg-error "deleted function" "" { target *-*-* } 69 }
+// { dg-error "deleted function" "" { target *-*-* } 66 }
index 127960a625db7b5c67cec321e84d2f8b9aefe92b..4dea137064f089677bd24d4783101a10dfff5ea1 100644 (file)
@@ -40,8 +40,8 @@ int main()
       std::unique_lock<std::mutex> l(m);
 
       auto then = std::chrono::system_clock::now();
-      std::cv_status result = c1.wait_for(l, ms);
-      VERIFY( result == std::cv_status::timeout );
+      bool result = c1.wait_for(l, ms);
+      VERIFY( !result );
       VERIFY( (std::chrono::system_clock::now() - then) >= ms );
       VERIFY( l.owns_lock() );
     }
index ab2e8776b8422d9855cc0f8733acdd7505d70fc4..fe176668aa01e6246e6e616891131c92a3f823b8 100644 (file)
@@ -40,8 +40,8 @@ int main()
       std::unique_lock<std::mutex> l(m);
 
       auto then = std::chrono::monotonic_clock::now();
-      std::cv_status result = c1.wait_until(l, then + ms);
-      VERIFY( result == std::cv_status::timeout );
+      bool result = c1.wait_until(l, then + ms);
+      VERIFY( !result );
       VERIFY( (std::chrono::monotonic_clock::now() - then) >= ms );
       VERIFY( l.owns_lock() );
     }
index 14990a292348463808f1f3364deaa7fd041e906e..473f32639b34a1332aef3ff4abfdac928f6729ff 100644 (file)
@@ -32,4 +32,4 @@ void test01()
 }
 
 // { dg-error "used here" "" { target *-*-* } 31 }
-// { dg-error "deleted function" "" { target *-*-* } 179 }
+// { dg-error "deleted function" "" { target *-*-* } 175 }
index 1a48a9e627cfa0f22ca23f8a6c40cdc9e74f41be..1d06c2ded3c3beebb759dda18b8b2670de297b4b 100644 (file)
@@ -31,4 +31,4 @@ void test01()
 }
 
 // { dg-error "used here" "" { target *-*-* } 30 }
-// { dg-error "deleted function" "" { target *-*-* } 178 }
+// { dg-error "deleted function" "" { target *-*-* } 174 }