OSDN Git Service

2009-12-17 Paolo Carlini <paolo.carlini@oracle.com>
authorpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 17 Dec 2009 11:09:05 +0000 (11:09 +0000)
committerpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 17 Dec 2009 11:09:05 +0000 (11:09 +0000)
PR libstdc++/42198
* src/thread.cc (thread::_M_start_thread): Throw system_error
immediately if the thread system is inactive.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@155308 138bc75d-0d04-0410-961f-82ee72b054a4

libstdc++-v3/ChangeLog
libstdc++-v3/src/thread.cc

index bf7f50e..05b0c1e 100644 (file)
@@ -1,3 +1,9 @@
+2009-12-17  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR libstdc++/42198
+       * src/thread.cc (thread::_M_start_thread): Throw system_error
+       immediately if the thread system is inactive.
+
 2009-12-16  Benjamin Kosnik  <bkoz@redhat.com>
 
        PR libstdc++/21772 part 2
index 334e5cb..879e864 100644 (file)
@@ -83,6 +83,9 @@ namespace std
   void
   thread::_M_start_thread(__shared_base_type __b)
   {
+    if (!__gthread_active_p())
+      __throw_system_error(int(errc::operation_not_permitted));
+
     __b->_M_this_ptr = __b;
     int __e = __gthread_create(&_M_id._M_thread,
                               &execute_native_thread_routine, __b.get());