diff options
author | bkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-02-13 23:08:50 +0000 |
---|---|---|
committer | bkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-02-13 23:08:50 +0000 |
commit | 7e507d1b230245b4416eb3649737402fabd73d7b (patch) | |
tree | 6e674392fa11494d375b32c8b0725a6b0d0cc32d /libstdc++-v3/src | |
parent | a6f624bd60682f85db63c4513c2bd70aadd7e3c3 (diff) | |
download | gcc-7e507d1b230245b4416eb3649737402fabd73d7b.tar.gz |
2009-02-13 Chris Fairles <cfairles@gcc.gnu.org>
Benjamin Kosnik <bkoz@redhat.com>
* include/std/thread (_Impl_base): Move _M_id out and into ...
(thread): ...here. Call _M_make_routine in body of constructors.
Adjust data member usage to reflect changes.
(_M_make_routine): From _M_make_shared_data.
(_M_start_thread): Add __shared_base_type argument.
* src/thread.cc: Fixups for above.
* config/abi/pre/gnu.ver: Adjust exports.
* testsuite/30_threads/thread/native_handle/typesizes.cc: Enable.
* testsuite/30_threads/thread/cons/assign_neg.cc: Adjust line numbers.
* testsuite/30_threads/thread/cons/copy_neg.cc: Same.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@144171 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/src')
-rw-r--r-- | libstdc++-v3/src/thread.cc | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/libstdc++-v3/src/thread.cc b/libstdc++-v3/src/thread.cc index 2c3b5dc5134..ad399254fba 100644 --- a/libstdc++-v3/src/thread.cc +++ b/libstdc++-v3/src/thread.cc @@ -61,16 +61,16 @@ namespace std { int __e = EINVAL; - if (_M_data) + if (_M_id != id()) { void* __r = 0; - __e = __gthread_join(_M_data->_M_id._M_thread, &__r); + __e = __gthread_join(_M_id._M_thread, &__r); } if (__e) __throw_system_error(__e); - _M_data.reset(); + _M_id = id(); } void @@ -78,24 +78,24 @@ namespace std { int __e = EINVAL; - if (_M_data) - __e = __gthread_detach(_M_data->_M_id._M_thread); + if (_M_id != id()) + __e = __gthread_detach(_M_id._M_thread); if (__e) __throw_system_error(__e); - _M_data.reset(); + _M_id = id(); } void - thread::_M_start_thread() + thread::_M_start_thread(__shared_base_type __b) { - _M_data->_M_this_ptr = _M_data; - int __e = __gthread_create(&_M_data->_M_id._M_thread, - &execute_native_thread_routine, _M_data.get()); + __b->_M_this_ptr = __b; + int __e = __gthread_create(&_M_id._M_thread, + &execute_native_thread_routine, __b.get()); if (__e) { - _M_data->_M_this_ptr.reset(); + __b->_M_this_ptr.reset(); __throw_system_error(__e); } } |