re PR libstdc++/52681 ([C++11] Using std::thread without -pthread crashes without warning)
PR libstdc++/52681 * src/c++11/thread.cc (thread::_M_start_thread): Improve error text when threads are not enabled. From-SVN: r190330
This commit is contained in:
parent
874a3756f2
commit
3722862e60
|
@ -1,3 +1,9 @@
|
|||
2012-08-12 Jonathan Wakely <jwakely.gcc@gmail.com>
|
||||
|
||||
PR libstdc++/52681
|
||||
* src/c++11/thread.cc (thread::_M_start_thread): Improve error text
|
||||
when threads are not enabled.
|
||||
|
||||
2012-08-09 Jonathan Wakely <jwakely.gcc@gmail.com>
|
||||
|
||||
* acinclude.m4: Update references to final C++11 standard.
|
||||
|
|
|
@ -115,7 +115,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
|
|||
thread::_M_start_thread(__shared_base_type __b)
|
||||
{
|
||||
if (!__gthread_active_p())
|
||||
#if __EXCEPTIONS
|
||||
throw system_error(make_error_code(errc::operation_not_permitted),
|
||||
"Enable multithreading to use std::thread");
|
||||
#else
|
||||
__throw_system_error(int(errc::operation_not_permitted));
|
||||
#endif
|
||||
|
||||
__b->_M_this_ptr = __b;
|
||||
int __e = __gthread_create(&_M_id._M_thread,
|
||||
|
|
Loading…
Reference in New Issue