This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] libstdc++/67726 LWG 2135: terminate() in condition_variable::wait()


This was a change between C++11 and C++14.

Tested powerpc64le-linux, committed to trunk.


commit 023e16117005d8ca7dbb0e2e61059b59d7cc0e40
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Mon Sep 28 17:47:35 2015 +0100

    LWG 2135: terminate() in condition_variable::wait()
    
    	* include/std/condition_variable (condition_variable::wait): Add
    	noexcept.
    	* src/c++11/condition_variable.cc (condition_variable::wait): Call
    	std::terminate on error (DR 2135).

diff --git a/libstdc++-v3/include/std/condition_variable b/libstdc++-v3/include/std/condition_variable
index 4714774..f5f7734 100644
--- a/libstdc++-v3/include/std/condition_variable
+++ b/libstdc++-v3/include/std/condition_variable
@@ -89,7 +89,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     notify_all() noexcept;
 
     void
-    wait(unique_lock<mutex>& __lock);
+    wait(unique_lock<mutex>& __lock) noexcept;
 
     template<typename _Predicate>
       void
diff --git a/libstdc++-v3/src/c++11/condition_variable.cc b/libstdc++-v3/src/c++11/condition_variable.cc
index cc0f6e4..fd850cb 100644
--- a/libstdc++-v3/src/c++11/condition_variable.cc
+++ b/libstdc++-v3/src/c++11/condition_variable.cc
@@ -48,12 +48,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   }
 
   void
-  condition_variable::wait(unique_lock<mutex>& __lock)
+  condition_variable::wait(unique_lock<mutex>& __lock) noexcept
   {
     int __e = __gthread_cond_wait(&_M_cond, __lock.mutex()->native_handle());
 
     if (__e)
-      __throw_system_error(__e);
+      std::terminate();
   }
 
   void

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]