diff options
author | Paolo Carlini <paolo.carlini@oracle.com> | 2009-12-17 11:09:05 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2009-12-17 11:09:05 +0000 |
commit | 45ed58a81f8f391e20bafd289f62da8b494b8c79 (patch) | |
tree | ee676cacfbbfecabc6570e5b31cd51212b1c1355 /libstdc++-v3/src | |
parent | 19c006ff7f5595d57b9021c262450c75583ddad9 (diff) | |
download | gcc-45ed58a81f8f391e20bafd289f62da8b494b8c79.zip gcc-45ed58a81f8f391e20bafd289f62da8b494b8c79.tar.gz gcc-45ed58a81f8f391e20bafd289f62da8b494b8c79.tar.bz2 |
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
Diffstat (limited to 'libstdc++-v3/src')
-rw-r--r-- | libstdc++-v3/src/thread.cc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libstdc++-v3/src/thread.cc b/libstdc++-v3/src/thread.cc index 334e5cb..879e864 100644 --- a/libstdc++-v3/src/thread.cc +++ b/libstdc++-v3/src/thread.cc @@ -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()); |