diff options
author | Benjamin Kosnik <bkoz@redhat.com> | 2009-02-10 08:29:57 +0000 |
---|---|---|
committer | Benjamin Kosnik <bkoz@gcc.gnu.org> | 2009-02-10 08:29:57 +0000 |
commit | f7459b6c53c4633371442d020051707bfcfcbdf1 (patch) | |
tree | 19f878843cba38e4bd49fe8d61f7521c7fad4342 /libstdc++-v3/src | |
parent | 7314b35ac278e60dd6576ffbab0b80dd4de74a69 (diff) | |
download | gcc-f7459b6c53c4633371442d020051707bfcfcbdf1.zip gcc-f7459b6c53c4633371442d020051707bfcfcbdf1.tar.gz gcc-f7459b6c53c4633371442d020051707bfcfcbdf1.tar.bz2 |
condition_variable (condition_variable): Remove _M_internal_mutex.
2009-02-09 Benjamin Kosnik <bkoz@redhat.com>
* include/std/condition_variable (condition_variable): Remove
_M_internal_mutex. Add private __native_type typedef.
* src/condition_variable.cc (condition_variable::notify_one):
Remove _M_internal_mutex use. Use typedef.
(condition_variable::notify_all): Same.
* include/std/mutex (mutex): Add private __native_type typedef. Use it.
(recursive_mutex): Same.
(timed_mutex): Same.
(recursive_timed_mutex): Same.
(once_flag): Make __native_type typedef private.
* include/std/thread (this_thread): Add minimal markup.
* testsuite/30_threads/condition_variable_any/cons/assign_neg.cc:
Adjust line numbers.
* testsuite/30_threads/condition_variable_any/cons/copy_neg.cc: Same.
* testsuite/30_threads/mutex/cons/assign_neg.cc: Same.
* testsuite/30_threads/mutex/cons/copy_neg.cc: Same.
* testsuite/30_threads/timed_mutex/cons/assign_neg.cc: Same.
* testsuite/30_threads/timed_mutex/cons/copy_neg.cc: Same.
* testsuite/30_threads/thread/cons/assign_neg.cc: Same.
* testsuite/30_threads/thread/cons/copy_neg.cc: Same.
* testsuite/30_threads/recursive_mutex/cons/assign_neg.cc: Same.
* testsuite/30_threads/recursive_mutex/cons/copy_neg.cc: Same.
* testsuite/30_threads/condition_variable/cons/assign_neg.cc: Same.
* testsuite/30_threads/condition_variable/cons/copy_neg.cc: Same.
* testsuite/30_threads/recursive_timed_mutex/cons/assign_neg.cc: Same.
* testsuite/30_threads/recursive_timed_mutex/cons/copy_neg.cc: Same.
* testsuite/util/thread/all.h: Testsuite utilities for testing thread.
* testsuite/30_threads/condition_variable_any/native_handle/
typesizes.cc: New.
* testsuite/30_threads/mutex/native_handle/typesizes.cc: Same.
* testsuite/30_threads/timed_mutex/native_handle/typesizes.cc: Same.
* testsuite/30_threads/thread/native_handle/typesizes.cc: Same.
* testsuite/30_threads/recursive_mutex/native_handle/typesizes.cc: Same.
* testsuite/30_threads/condition_variable/native_handle/
typesizes.cc: Same.
* testsuite/30_threads/recursive_timed_mutex/native_handle/
typesizes.cc: Same.
From-SVN: r144053
Diffstat (limited to 'libstdc++-v3/src')
-rw-r--r-- | libstdc++-v3/src/condition_variable.cc | 8 | ||||
-rw-r--r-- | libstdc++-v3/src/thread.cc | 3 |
2 files changed, 4 insertions, 7 deletions
diff --git a/libstdc++-v3/src/condition_variable.cc b/libstdc++-v3/src/condition_variable.cc index cdad051..c916bf0 100644 --- a/libstdc++-v3/src/condition_variable.cc +++ b/libstdc++-v3/src/condition_variable.cc @@ -1,6 +1,6 @@ // condition_variable -*- C++ -*- -// Copyright (C) 2008 Free Software Foundation, Inc. +// Copyright (C) 2008, 2009 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -36,7 +36,7 @@ namespace std condition_variable::condition_variable() { #ifdef __GTHREAD_COND_INIT - __gthread_cond_t __tmp = __GTHREAD_COND_INIT; + __native_type __tmp = __GTHREAD_COND_INIT; _M_cond = __tmp; #else int __e = __gthread_cond_init(&_M_cond, NULL); @@ -65,7 +65,6 @@ namespace std void condition_variable::notify_one() { - lock_guard<mutex> __lock(_M_internal_mutex); int __e = __gthread_cond_signal(&_M_cond); // XXX not in spec @@ -77,7 +76,6 @@ namespace std void condition_variable::notify_all() { - lock_guard<mutex> __lock(_M_internal_mutex); int __e = __gthread_cond_broadcast(&_M_cond); // XXX not in spec @@ -89,7 +87,7 @@ namespace std condition_variable_any::condition_variable_any() { #ifdef __GTHREAD_COND_INIT - __gthread_cond_t __tmp = __GTHREAD_COND_INIT; + __native_type __tmp = __GTHREAD_COND_INIT; _M_cond = __tmp; #else int __e = __gthread_cond_init(&_M_cond, NULL); diff --git a/libstdc++-v3/src/thread.cc b/libstdc++-v3/src/thread.cc index bc30283..2c3b5dc 100644 --- a/libstdc++-v3/src/thread.cc +++ b/libstdc++-v3/src/thread.cc @@ -45,7 +45,7 @@ namespace std __try { - __local->_M_run(); + __t->_M_run(); } __catch(...) { @@ -90,7 +90,6 @@ namespace std void thread::_M_start_thread() { - // _M_data->_M_this_ptr = _M_data; _M_data->_M_this_ptr = _M_data; int __e = __gthread_create(&_M_data->_M_id._M_thread, &execute_native_thread_routine, _M_data.get()); |