aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/src/thread.cc
diff options
context:
space:
mode:
authorChris Fairles <cfairles@gcc.gnu.org>2009-02-13 23:08:50 +0000
committerBenjamin Kosnik <bkoz@gcc.gnu.org>2009-02-13 23:08:50 +0000
commit626dda69bc56a1686fc144ca073dbc92ff83eb0f (patch)
tree6e674392fa11494d375b32c8b0725a6b0d0cc32d /libstdc++-v3/src/thread.cc
parent2d05f84dc4adbeb3881a7d7b27b65520aef8bb5c (diff)
downloadgcc-626dda69bc56a1686fc144ca073dbc92ff83eb0f.zip
gcc-626dda69bc56a1686fc144ca073dbc92ff83eb0f.tar.gz
gcc-626dda69bc56a1686fc144ca073dbc92ff83eb0f.tar.bz2
thread (_Impl_base): Move _M_id out and into ...
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. Co-Authored-By: Benjamin Kosnik <bkoz@redhat.com> From-SVN: r144171
Diffstat (limited to 'libstdc++-v3/src/thread.cc')
-rw-r--r--libstdc++-v3/src/thread.cc22
1 files changed, 11 insertions, 11 deletions
diff --git a/libstdc++-v3/src/thread.cc b/libstdc++-v3/src/thread.cc
index 2c3b5dc..ad39925 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);
}
}