Commit 45ed58a8 by Paolo Carlini Committed by Paolo Carlini

re PR libstdc++/42198 ([C++0x] Using std::thread without -pthread causes immediate crash)

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.

From-SVN: r155308
parent 19c006ff
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> 2009-12-16 Benjamin Kosnik <bkoz@redhat.com>
PR libstdc++/21772 part 2 PR libstdc++/21772 part 2
......
...@@ -83,6 +83,9 @@ namespace std ...@@ -83,6 +83,9 @@ namespace std
void void
thread::_M_start_thread(__shared_base_type __b) 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; __b->_M_this_ptr = __b;
int __e = __gthread_create(&_M_id._M_thread, int __e = __gthread_create(&_M_id._M_thread,
&execute_native_thread_routine, __b.get()); &execute_native_thread_routine, __b.get());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment