gcc/libstdc++-v3/include/std/condition_variable

287 lines
7.8 KiB
Plaintext
Raw Normal View History

condition_variable: New. 2008-05-06 Benjamin Kosnik <bkoz@redhat.com> * include/std/condition_variable: New. * include/std/mutex: New. * src/condition_variable.cc: New. * src/mutex.cc: New. * include/bits/functexcept.h: Add __throw_system_error varients. * src/functexcept.cc: Same. * config/abi/pre/gnu.ver: Add exports. * doc/xml/manual/using.xml: Add new includes. * doc/doxygen/user.cfg.in: Doxygen support. * doc/doxygen/doxygroups.cc: Same. * include/Makefile.am: Add mutex, condition_variable. * include/Makefile.in: Regenerated. * src/Makefile.am: Add mutex.cc, condition_variable.cc. * src/Makefile.in: Regenerated. * testsuite/30_threads: New. * testsuite/30_threads/lock_error: New. * testsuite/30_threads/mutex: New. * testsuite/30_threads/mutex/dest: New. * testsuite/30_threads/mutex/dest/destructor_locked.cc: New. * testsuite/30_threads/mutex/native_handle: New. * testsuite/30_threads/mutex/native_handle/1.cc: New. * testsuite/30_threads/mutex/cons: New. * testsuite/30_threads/mutex/cons/assign_neg.cc: New. * testsuite/30_threads/mutex/cons/1.cc: New. * testsuite/30_threads/mutex/cons/copy_neg.cc: New. * testsuite/30_threads/mutex/requirements: New. * testsuite/30_threads/mutex/requirements/typedefs.cc: New. * testsuite/30_threads/mutex/try_lock: New. * testsuite/30_threads/mutex/try_lock/1.cc: New. * testsuite/30_threads/mutex/try_lock/2.cc: New. * testsuite/30_threads/mutex/lock: New. * testsuite/30_threads/mutex/lock/1.cc: New. * testsuite/30_threads/mutex/unlock: New. * testsuite/30_threads/mutex/unlock/1.cc: New. * testsuite/30_threads/recursive_mutex: New. * testsuite/30_threads/recursive_mutex/dest: New. * testsuite/30_threads/recursive_mutex/dest/destructor_locked.cc: New. * testsuite/30_threads/recursive_mutex/native_handle: New. * testsuite/30_threads/recursive_mutex/native_handle/1.cc: New. * testsuite/30_threads/recursive_mutex/cons: New. * testsuite/30_threads/recursive_mutex/cons/assign_neg.cc: New. * testsuite/30_threads/recursive_mutex/cons/1.cc: New. * testsuite/30_threads/recursive_mutex/cons/copy_neg.cc: New. * testsuite/30_threads/recursive_mutex/requirements: New. * testsuite/30_threads/recursive_mutex/requirements/typedefs.cc: New. * testsuite/30_threads/lock_guard: New. * testsuite/30_threads/lock_guard/requirements: New. * testsuite/30_threads/lock_guard/requirements/typedefs.cc: New. * testsuite/30_threads/lock_guard/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/headers: New. * testsuite/30_threads/headers/mutex: New. * testsuite/30_threads/headers/mutex/types_std_c++0x.cc: New. * testsuite/30_threads/headers/mutex/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/condition_variable: New. * testsuite/30_threads/headers/condition_variable/ types_std_c++0x.cc: New. * testsuite/30_threads/headers/condition_variable/std_c++0x_neg.cc: New. * testsuite/30_threads/once_flag: New. * testsuite/30_threads/unique_lock: New. * testsuite/30_threads/unique_lock/requirements: New. * testsuite/30_threads/unique_lock/requirements/typedefs.cc: New. * testsuite/30_threads/unique_lock/requirements/ explicit_instantiation.cc: New. * testsuite/17_intro/headers/c++200x/all.cc: Add new includes. From-SVN: r135007
2008-05-06 23:11:47 +02:00
// <condition_variable> -*- C++ -*-
// Copyright (C) 2008-2012 Free Software Foundation, Inc.
condition_variable: New. 2008-05-06 Benjamin Kosnik <bkoz@redhat.com> * include/std/condition_variable: New. * include/std/mutex: New. * src/condition_variable.cc: New. * src/mutex.cc: New. * include/bits/functexcept.h: Add __throw_system_error varients. * src/functexcept.cc: Same. * config/abi/pre/gnu.ver: Add exports. * doc/xml/manual/using.xml: Add new includes. * doc/doxygen/user.cfg.in: Doxygen support. * doc/doxygen/doxygroups.cc: Same. * include/Makefile.am: Add mutex, condition_variable. * include/Makefile.in: Regenerated. * src/Makefile.am: Add mutex.cc, condition_variable.cc. * src/Makefile.in: Regenerated. * testsuite/30_threads: New. * testsuite/30_threads/lock_error: New. * testsuite/30_threads/mutex: New. * testsuite/30_threads/mutex/dest: New. * testsuite/30_threads/mutex/dest/destructor_locked.cc: New. * testsuite/30_threads/mutex/native_handle: New. * testsuite/30_threads/mutex/native_handle/1.cc: New. * testsuite/30_threads/mutex/cons: New. * testsuite/30_threads/mutex/cons/assign_neg.cc: New. * testsuite/30_threads/mutex/cons/1.cc: New. * testsuite/30_threads/mutex/cons/copy_neg.cc: New. * testsuite/30_threads/mutex/requirements: New. * testsuite/30_threads/mutex/requirements/typedefs.cc: New. * testsuite/30_threads/mutex/try_lock: New. * testsuite/30_threads/mutex/try_lock/1.cc: New. * testsuite/30_threads/mutex/try_lock/2.cc: New. * testsuite/30_threads/mutex/lock: New. * testsuite/30_threads/mutex/lock/1.cc: New. * testsuite/30_threads/mutex/unlock: New. * testsuite/30_threads/mutex/unlock/1.cc: New. * testsuite/30_threads/recursive_mutex: New. * testsuite/30_threads/recursive_mutex/dest: New. * testsuite/30_threads/recursive_mutex/dest/destructor_locked.cc: New. * testsuite/30_threads/recursive_mutex/native_handle: New. * testsuite/30_threads/recursive_mutex/native_handle/1.cc: New. * testsuite/30_threads/recursive_mutex/cons: New. * testsuite/30_threads/recursive_mutex/cons/assign_neg.cc: New. * testsuite/30_threads/recursive_mutex/cons/1.cc: New. * testsuite/30_threads/recursive_mutex/cons/copy_neg.cc: New. * testsuite/30_threads/recursive_mutex/requirements: New. * testsuite/30_threads/recursive_mutex/requirements/typedefs.cc: New. * testsuite/30_threads/lock_guard: New. * testsuite/30_threads/lock_guard/requirements: New. * testsuite/30_threads/lock_guard/requirements/typedefs.cc: New. * testsuite/30_threads/lock_guard/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/headers: New. * testsuite/30_threads/headers/mutex: New. * testsuite/30_threads/headers/mutex/types_std_c++0x.cc: New. * testsuite/30_threads/headers/mutex/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/condition_variable: New. * testsuite/30_threads/headers/condition_variable/ types_std_c++0x.cc: New. * testsuite/30_threads/headers/condition_variable/std_c++0x_neg.cc: New. * testsuite/30_threads/once_flag: New. * testsuite/30_threads/unique_lock: New. * testsuite/30_threads/unique_lock/requirements: New. * testsuite/30_threads/unique_lock/requirements/typedefs.cc: New. * testsuite/30_threads/unique_lock/requirements/ explicit_instantiation.cc: New. * testsuite/17_intro/headers/c++200x/all.cc: Add new includes. From-SVN: r135007
2008-05-06 23:11:47 +02:00
//
// 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
condition_variable: New. 2008-05-06 Benjamin Kosnik <bkoz@redhat.com> * include/std/condition_variable: New. * include/std/mutex: New. * src/condition_variable.cc: New. * src/mutex.cc: New. * include/bits/functexcept.h: Add __throw_system_error varients. * src/functexcept.cc: Same. * config/abi/pre/gnu.ver: Add exports. * doc/xml/manual/using.xml: Add new includes. * doc/doxygen/user.cfg.in: Doxygen support. * doc/doxygen/doxygroups.cc: Same. * include/Makefile.am: Add mutex, condition_variable. * include/Makefile.in: Regenerated. * src/Makefile.am: Add mutex.cc, condition_variable.cc. * src/Makefile.in: Regenerated. * testsuite/30_threads: New. * testsuite/30_threads/lock_error: New. * testsuite/30_threads/mutex: New. * testsuite/30_threads/mutex/dest: New. * testsuite/30_threads/mutex/dest/destructor_locked.cc: New. * testsuite/30_threads/mutex/native_handle: New. * testsuite/30_threads/mutex/native_handle/1.cc: New. * testsuite/30_threads/mutex/cons: New. * testsuite/30_threads/mutex/cons/assign_neg.cc: New. * testsuite/30_threads/mutex/cons/1.cc: New. * testsuite/30_threads/mutex/cons/copy_neg.cc: New. * testsuite/30_threads/mutex/requirements: New. * testsuite/30_threads/mutex/requirements/typedefs.cc: New. * testsuite/30_threads/mutex/try_lock: New. * testsuite/30_threads/mutex/try_lock/1.cc: New. * testsuite/30_threads/mutex/try_lock/2.cc: New. * testsuite/30_threads/mutex/lock: New. * testsuite/30_threads/mutex/lock/1.cc: New. * testsuite/30_threads/mutex/unlock: New. * testsuite/30_threads/mutex/unlock/1.cc: New. * testsuite/30_threads/recursive_mutex: New. * testsuite/30_threads/recursive_mutex/dest: New. * testsuite/30_threads/recursive_mutex/dest/destructor_locked.cc: New. * testsuite/30_threads/recursive_mutex/native_handle: New. * testsuite/30_threads/recursive_mutex/native_handle/1.cc: New. * testsuite/30_threads/recursive_mutex/cons: New. * testsuite/30_threads/recursive_mutex/cons/assign_neg.cc: New. * testsuite/30_threads/recursive_mutex/cons/1.cc: New. * testsuite/30_threads/recursive_mutex/cons/copy_neg.cc: New. * testsuite/30_threads/recursive_mutex/requirements: New. * testsuite/30_threads/recursive_mutex/requirements/typedefs.cc: New. * testsuite/30_threads/lock_guard: New. * testsuite/30_threads/lock_guard/requirements: New. * testsuite/30_threads/lock_guard/requirements/typedefs.cc: New. * testsuite/30_threads/lock_guard/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/headers: New. * testsuite/30_threads/headers/mutex: New. * testsuite/30_threads/headers/mutex/types_std_c++0x.cc: New. * testsuite/30_threads/headers/mutex/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/condition_variable: New. * testsuite/30_threads/headers/condition_variable/ types_std_c++0x.cc: New. * testsuite/30_threads/headers/condition_variable/std_c++0x_neg.cc: New. * testsuite/30_threads/once_flag: New. * testsuite/30_threads/unique_lock: New. * testsuite/30_threads/unique_lock/requirements: New. * testsuite/30_threads/unique_lock/requirements/typedefs.cc: New. * testsuite/30_threads/unique_lock/requirements/ explicit_instantiation.cc: New. * testsuite/17_intro/headers/c++200x/all.cc: Add new includes. From-SVN: r135007
2008-05-06 23:11:47 +02:00
// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// Under Section 7 of GPL version 3, you are granted additional
// permissions described in the GCC Runtime Library Exception, version
// 3.1, as published by the Free Software Foundation.
condition_variable: New. 2008-05-06 Benjamin Kosnik <bkoz@redhat.com> * include/std/condition_variable: New. * include/std/mutex: New. * src/condition_variable.cc: New. * src/mutex.cc: New. * include/bits/functexcept.h: Add __throw_system_error varients. * src/functexcept.cc: Same. * config/abi/pre/gnu.ver: Add exports. * doc/xml/manual/using.xml: Add new includes. * doc/doxygen/user.cfg.in: Doxygen support. * doc/doxygen/doxygroups.cc: Same. * include/Makefile.am: Add mutex, condition_variable. * include/Makefile.in: Regenerated. * src/Makefile.am: Add mutex.cc, condition_variable.cc. * src/Makefile.in: Regenerated. * testsuite/30_threads: New. * testsuite/30_threads/lock_error: New. * testsuite/30_threads/mutex: New. * testsuite/30_threads/mutex/dest: New. * testsuite/30_threads/mutex/dest/destructor_locked.cc: New. * testsuite/30_threads/mutex/native_handle: New. * testsuite/30_threads/mutex/native_handle/1.cc: New. * testsuite/30_threads/mutex/cons: New. * testsuite/30_threads/mutex/cons/assign_neg.cc: New. * testsuite/30_threads/mutex/cons/1.cc: New. * testsuite/30_threads/mutex/cons/copy_neg.cc: New. * testsuite/30_threads/mutex/requirements: New. * testsuite/30_threads/mutex/requirements/typedefs.cc: New. * testsuite/30_threads/mutex/try_lock: New. * testsuite/30_threads/mutex/try_lock/1.cc: New. * testsuite/30_threads/mutex/try_lock/2.cc: New. * testsuite/30_threads/mutex/lock: New. * testsuite/30_threads/mutex/lock/1.cc: New. * testsuite/30_threads/mutex/unlock: New. * testsuite/30_threads/mutex/unlock/1.cc: New. * testsuite/30_threads/recursive_mutex: New. * testsuite/30_threads/recursive_mutex/dest: New. * testsuite/30_threads/recursive_mutex/dest/destructor_locked.cc: New. * testsuite/30_threads/recursive_mutex/native_handle: New. * testsuite/30_threads/recursive_mutex/native_handle/1.cc: New. * testsuite/30_threads/recursive_mutex/cons: New. * testsuite/30_threads/recursive_mutex/cons/assign_neg.cc: New. * testsuite/30_threads/recursive_mutex/cons/1.cc: New. * testsuite/30_threads/recursive_mutex/cons/copy_neg.cc: New. * testsuite/30_threads/recursive_mutex/requirements: New. * testsuite/30_threads/recursive_mutex/requirements/typedefs.cc: New. * testsuite/30_threads/lock_guard: New. * testsuite/30_threads/lock_guard/requirements: New. * testsuite/30_threads/lock_guard/requirements/typedefs.cc: New. * testsuite/30_threads/lock_guard/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/headers: New. * testsuite/30_threads/headers/mutex: New. * testsuite/30_threads/headers/mutex/types_std_c++0x.cc: New. * testsuite/30_threads/headers/mutex/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/condition_variable: New. * testsuite/30_threads/headers/condition_variable/ types_std_c++0x.cc: New. * testsuite/30_threads/headers/condition_variable/std_c++0x_neg.cc: New. * testsuite/30_threads/once_flag: New. * testsuite/30_threads/unique_lock: New. * testsuite/30_threads/unique_lock/requirements: New. * testsuite/30_threads/unique_lock/requirements/typedefs.cc: New. * testsuite/30_threads/unique_lock/requirements/ explicit_instantiation.cc: New. * testsuite/17_intro/headers/c++200x/all.cc: Add new includes. From-SVN: r135007
2008-05-06 23:11:47 +02:00
// You should have received a copy of the GNU General Public License and
// a copy of the GCC Runtime Library Exception along with this program;
// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
// <http://www.gnu.org/licenses/>.
condition_variable: New. 2008-05-06 Benjamin Kosnik <bkoz@redhat.com> * include/std/condition_variable: New. * include/std/mutex: New. * src/condition_variable.cc: New. * src/mutex.cc: New. * include/bits/functexcept.h: Add __throw_system_error varients. * src/functexcept.cc: Same. * config/abi/pre/gnu.ver: Add exports. * doc/xml/manual/using.xml: Add new includes. * doc/doxygen/user.cfg.in: Doxygen support. * doc/doxygen/doxygroups.cc: Same. * include/Makefile.am: Add mutex, condition_variable. * include/Makefile.in: Regenerated. * src/Makefile.am: Add mutex.cc, condition_variable.cc. * src/Makefile.in: Regenerated. * testsuite/30_threads: New. * testsuite/30_threads/lock_error: New. * testsuite/30_threads/mutex: New. * testsuite/30_threads/mutex/dest: New. * testsuite/30_threads/mutex/dest/destructor_locked.cc: New. * testsuite/30_threads/mutex/native_handle: New. * testsuite/30_threads/mutex/native_handle/1.cc: New. * testsuite/30_threads/mutex/cons: New. * testsuite/30_threads/mutex/cons/assign_neg.cc: New. * testsuite/30_threads/mutex/cons/1.cc: New. * testsuite/30_threads/mutex/cons/copy_neg.cc: New. * testsuite/30_threads/mutex/requirements: New. * testsuite/30_threads/mutex/requirements/typedefs.cc: New. * testsuite/30_threads/mutex/try_lock: New. * testsuite/30_threads/mutex/try_lock/1.cc: New. * testsuite/30_threads/mutex/try_lock/2.cc: New. * testsuite/30_threads/mutex/lock: New. * testsuite/30_threads/mutex/lock/1.cc: New. * testsuite/30_threads/mutex/unlock: New. * testsuite/30_threads/mutex/unlock/1.cc: New. * testsuite/30_threads/recursive_mutex: New. * testsuite/30_threads/recursive_mutex/dest: New. * testsuite/30_threads/recursive_mutex/dest/destructor_locked.cc: New. * testsuite/30_threads/recursive_mutex/native_handle: New. * testsuite/30_threads/recursive_mutex/native_handle/1.cc: New. * testsuite/30_threads/recursive_mutex/cons: New. * testsuite/30_threads/recursive_mutex/cons/assign_neg.cc: New. * testsuite/30_threads/recursive_mutex/cons/1.cc: New. * testsuite/30_threads/recursive_mutex/cons/copy_neg.cc: New. * testsuite/30_threads/recursive_mutex/requirements: New. * testsuite/30_threads/recursive_mutex/requirements/typedefs.cc: New. * testsuite/30_threads/lock_guard: New. * testsuite/30_threads/lock_guard/requirements: New. * testsuite/30_threads/lock_guard/requirements/typedefs.cc: New. * testsuite/30_threads/lock_guard/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/headers: New. * testsuite/30_threads/headers/mutex: New. * testsuite/30_threads/headers/mutex/types_std_c++0x.cc: New. * testsuite/30_threads/headers/mutex/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/condition_variable: New. * testsuite/30_threads/headers/condition_variable/ types_std_c++0x.cc: New. * testsuite/30_threads/headers/condition_variable/std_c++0x_neg.cc: New. * testsuite/30_threads/once_flag: New. * testsuite/30_threads/unique_lock: New. * testsuite/30_threads/unique_lock/requirements: New. * testsuite/30_threads/unique_lock/requirements/typedefs.cc: New. * testsuite/30_threads/unique_lock/requirements/ explicit_instantiation.cc: New. * testsuite/17_intro/headers/c++200x/all.cc: Add new includes. From-SVN: r135007
2008-05-06 23:11:47 +02:00
/** @file include/condition_variable
condition_variable: New. 2008-05-06 Benjamin Kosnik <bkoz@redhat.com> * include/std/condition_variable: New. * include/std/mutex: New. * src/condition_variable.cc: New. * src/mutex.cc: New. * include/bits/functexcept.h: Add __throw_system_error varients. * src/functexcept.cc: Same. * config/abi/pre/gnu.ver: Add exports. * doc/xml/manual/using.xml: Add new includes. * doc/doxygen/user.cfg.in: Doxygen support. * doc/doxygen/doxygroups.cc: Same. * include/Makefile.am: Add mutex, condition_variable. * include/Makefile.in: Regenerated. * src/Makefile.am: Add mutex.cc, condition_variable.cc. * src/Makefile.in: Regenerated. * testsuite/30_threads: New. * testsuite/30_threads/lock_error: New. * testsuite/30_threads/mutex: New. * testsuite/30_threads/mutex/dest: New. * testsuite/30_threads/mutex/dest/destructor_locked.cc: New. * testsuite/30_threads/mutex/native_handle: New. * testsuite/30_threads/mutex/native_handle/1.cc: New. * testsuite/30_threads/mutex/cons: New. * testsuite/30_threads/mutex/cons/assign_neg.cc: New. * testsuite/30_threads/mutex/cons/1.cc: New. * testsuite/30_threads/mutex/cons/copy_neg.cc: New. * testsuite/30_threads/mutex/requirements: New. * testsuite/30_threads/mutex/requirements/typedefs.cc: New. * testsuite/30_threads/mutex/try_lock: New. * testsuite/30_threads/mutex/try_lock/1.cc: New. * testsuite/30_threads/mutex/try_lock/2.cc: New. * testsuite/30_threads/mutex/lock: New. * testsuite/30_threads/mutex/lock/1.cc: New. * testsuite/30_threads/mutex/unlock: New. * testsuite/30_threads/mutex/unlock/1.cc: New. * testsuite/30_threads/recursive_mutex: New. * testsuite/30_threads/recursive_mutex/dest: New. * testsuite/30_threads/recursive_mutex/dest/destructor_locked.cc: New. * testsuite/30_threads/recursive_mutex/native_handle: New. * testsuite/30_threads/recursive_mutex/native_handle/1.cc: New. * testsuite/30_threads/recursive_mutex/cons: New. * testsuite/30_threads/recursive_mutex/cons/assign_neg.cc: New. * testsuite/30_threads/recursive_mutex/cons/1.cc: New. * testsuite/30_threads/recursive_mutex/cons/copy_neg.cc: New. * testsuite/30_threads/recursive_mutex/requirements: New. * testsuite/30_threads/recursive_mutex/requirements/typedefs.cc: New. * testsuite/30_threads/lock_guard: New. * testsuite/30_threads/lock_guard/requirements: New. * testsuite/30_threads/lock_guard/requirements/typedefs.cc: New. * testsuite/30_threads/lock_guard/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/headers: New. * testsuite/30_threads/headers/mutex: New. * testsuite/30_threads/headers/mutex/types_std_c++0x.cc: New. * testsuite/30_threads/headers/mutex/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/condition_variable: New. * testsuite/30_threads/headers/condition_variable/ types_std_c++0x.cc: New. * testsuite/30_threads/headers/condition_variable/std_c++0x_neg.cc: New. * testsuite/30_threads/once_flag: New. * testsuite/30_threads/unique_lock: New. * testsuite/30_threads/unique_lock/requirements: New. * testsuite/30_threads/unique_lock/requirements/typedefs.cc: New. * testsuite/30_threads/unique_lock/requirements/ explicit_instantiation.cc: New. * testsuite/17_intro/headers/c++200x/all.cc: Add new includes. From-SVN: r135007
2008-05-06 23:11:47 +02:00
* This is a Standard C++ Library header.
*/
#ifndef _GLIBCXX_CONDITION_VARIABLE
#define _GLIBCXX_CONDITION_VARIABLE 1
#pragma GCC system_header
#if __cplusplus < 201103L
hashtable.h: Fold in include/tr1_impl/hashtable.h contents. 2010-02-10 Paolo Carlini <paolo.carlini@oracle.com> * include/tr1/hashtable.h: Fold in include/tr1_impl/hashtable.h contents. * include/tr1_impl/hashtable.h: Remove. * include/tr1_impl/hashtable_policy.h: Move and rename... * include/tr1/hashtable_policy.h: ... here. * include/tr1_impl/unordered_map: Move and rename... * include/tr1/unordered_map.h: ... here. * include/tr1_impl/unordered_set: Move and rename... * include/tr1/unordered_set.h: ... here. * include/tr1_impl/unordered_map: Move and rename... * include/tr1/unordered_map.h: ... here. * include/tr1/unordered_map: Adjust. * include/tr1/unordered_set: Likewise. * include/Makefile.am: Adjust. * include/Makefile.in: Regenerate. * include/std/c++0x_warning.h: Move... * include/bits/c++0x_warning.h: ... here. * include/debug/unordered_map: Adjust. * include/debug/unordered_set: Likewise. * include/std/tuple: Likewise. * include/std/system_error: Likewise. * include/std/forward_list: Likewise. * include/std/thread: Likewise. * include/std/type_traits: Likewise. * include/std/future: Likewise. * include/std/regex: Likewise. * include/std/atomic: Likewise. * include/std/ratio: Likewise. * include/std/random: Likewise. * include/std/unordered_map: Likewise. * include/std/chrono: Likewise.: Likewise. * include/std/condition_variable: Likewise. * include/std/mutex: Likewise. * include/std/unordered_set: Likewise. * include/std/array: Likewise. * include/profile/unordered_map: Likewise. * include/profile/unordered_set: Likewise. * include/c_global/cinttypes: Likewise. * include/c_global/ctgmath: Likewise. * include/c_global/cfenv: Likewise. * include/c_global/cstdint: Likewise. * include/c_global/cstdbool: Likewise. * include/c_global/ccomplex: Likewise. * include/bits/shared_ptr.h: Do not include <bits/c++0x_warning.h> at all, the file is not meant to be included by the users. * include/bits/functional_hash.h: Likewise. * include/bits/unique_ptr.h: Likewise. * include/bits/forward_list.h: Likewise. * testsuite/29_atomics/atomic/cons/assign_neg.cc: Adjust dg-* line numbers. * testsuite/29_atomics/atomic/cons/copy_neg.cc: Likewise. * testsuite/23_containers/forward_list/requirements/dr438/ assign_neg.cc: Likewise. * testsuite/23_containers/forward_list/requirements/dr438/ insert_neg.cc: Likewise. * testsuite/23_containers/forward_list/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/forward_list/requirements/dr438/ constructor_2_neg.cc: Likewise. * testsuite/20_util/unique_ptr/modifiers/reset_neg.cc: Likewise. * testsuite/20_util/unique_ptr/assign/assign_neg.cc: Likewise. From-SVN: r156667
2010-02-10 20:14:33 +01:00
# include <bits/c++0x_warning.h>
#else
condition_variable: New. 2008-05-06 Benjamin Kosnik <bkoz@redhat.com> * include/std/condition_variable: New. * include/std/mutex: New. * src/condition_variable.cc: New. * src/mutex.cc: New. * include/bits/functexcept.h: Add __throw_system_error varients. * src/functexcept.cc: Same. * config/abi/pre/gnu.ver: Add exports. * doc/xml/manual/using.xml: Add new includes. * doc/doxygen/user.cfg.in: Doxygen support. * doc/doxygen/doxygroups.cc: Same. * include/Makefile.am: Add mutex, condition_variable. * include/Makefile.in: Regenerated. * src/Makefile.am: Add mutex.cc, condition_variable.cc. * src/Makefile.in: Regenerated. * testsuite/30_threads: New. * testsuite/30_threads/lock_error: New. * testsuite/30_threads/mutex: New. * testsuite/30_threads/mutex/dest: New. * testsuite/30_threads/mutex/dest/destructor_locked.cc: New. * testsuite/30_threads/mutex/native_handle: New. * testsuite/30_threads/mutex/native_handle/1.cc: New. * testsuite/30_threads/mutex/cons: New. * testsuite/30_threads/mutex/cons/assign_neg.cc: New. * testsuite/30_threads/mutex/cons/1.cc: New. * testsuite/30_threads/mutex/cons/copy_neg.cc: New. * testsuite/30_threads/mutex/requirements: New. * testsuite/30_threads/mutex/requirements/typedefs.cc: New. * testsuite/30_threads/mutex/try_lock: New. * testsuite/30_threads/mutex/try_lock/1.cc: New. * testsuite/30_threads/mutex/try_lock/2.cc: New. * testsuite/30_threads/mutex/lock: New. * testsuite/30_threads/mutex/lock/1.cc: New. * testsuite/30_threads/mutex/unlock: New. * testsuite/30_threads/mutex/unlock/1.cc: New. * testsuite/30_threads/recursive_mutex: New. * testsuite/30_threads/recursive_mutex/dest: New. * testsuite/30_threads/recursive_mutex/dest/destructor_locked.cc: New. * testsuite/30_threads/recursive_mutex/native_handle: New. * testsuite/30_threads/recursive_mutex/native_handle/1.cc: New. * testsuite/30_threads/recursive_mutex/cons: New. * testsuite/30_threads/recursive_mutex/cons/assign_neg.cc: New. * testsuite/30_threads/recursive_mutex/cons/1.cc: New. * testsuite/30_threads/recursive_mutex/cons/copy_neg.cc: New. * testsuite/30_threads/recursive_mutex/requirements: New. * testsuite/30_threads/recursive_mutex/requirements/typedefs.cc: New. * testsuite/30_threads/lock_guard: New. * testsuite/30_threads/lock_guard/requirements: New. * testsuite/30_threads/lock_guard/requirements/typedefs.cc: New. * testsuite/30_threads/lock_guard/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/headers: New. * testsuite/30_threads/headers/mutex: New. * testsuite/30_threads/headers/mutex/types_std_c++0x.cc: New. * testsuite/30_threads/headers/mutex/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/condition_variable: New. * testsuite/30_threads/headers/condition_variable/ types_std_c++0x.cc: New. * testsuite/30_threads/headers/condition_variable/std_c++0x_neg.cc: New. * testsuite/30_threads/once_flag: New. * testsuite/30_threads/unique_lock: New. * testsuite/30_threads/unique_lock/requirements: New. * testsuite/30_threads/unique_lock/requirements/typedefs.cc: New. * testsuite/30_threads/unique_lock/requirements/ explicit_instantiation.cc: New. * testsuite/17_intro/headers/c++200x/all.cc: Add new includes. From-SVN: r135007
2008-05-06 23:11:47 +02:00
condition_variable: Use new deleted ctors. 2008-09-03 Chris Fairles <chris.fairles@gmail.com> * include/std/condition_variable: Use new deleted ctors. * include/std/mutex: Likewise plus implement timed_mutex, recursive_timed_mutex and call_once. * src/condition_variable.cc: Implement wait(). Use gthread types. Remove _GTHREADS_HAS_COND checks in favor of global _GLIBCXX_HAS_GTHREADS. * src/mutex.cc (call_once): Implementation using TLS with mutex fallback. * config/abi/pre/gnu.ver: Add exported symbols. * testsuite/lib/libstdc++.exp (check_v3_target_gthreads): New. * testsuite/lib/dg-options.exp (dg-require-gthreads): Likewise. * testsuite/30_threads/lock_guard/requirements/typedefs.cc: Use dg-require-gthreads and dg-require-cstdint. * testsuite/30_threads/lock_guard/requirements/ explicit_instantiation.cc: Likewise. * testsuite/30_threads/mutex/dest/destructor_locked.cc: Likewise. * testsuite/30_threads/mutex/native_handle/1.cc: Likewise. * testsuite/30_threads/mutex/cons/1.cc: Likewise. * testsuite/30_threads/mutex/requirements/typedefs.cc: Likewise. * testsuite/30_threads/mutex/try_lock/1.cc: Likewise. * testsuite/30_threads/mutex/try_lock/2.cc: Likewise. * testsuite/30_threads/mutex/lock/1.cc: Likewise. * testsuite/30_threads/mutex/unlock/1.cc: Likewise. * testsuite/30_threads/recursive_mutex/dest/destructor_locked.cc: Likewise. * testsuite/30_threads/recursive_mutex/native_handle/1.cc: Likewise. * testsuite/30_threads/recursive_mutex/cons/1.cc: Likewise. * testsuite/30_threads/recursive_mutex/requirements/typedefs.cc: Likewise. * testsuite/30_threads/recursive_mutex/try_lock/1.cc: Likewise. * testsuite/30_threads/recursive_mutex/try_lock/2.cc: Likewise. * testsuite/30_threads/recursive_mutex/lock/1.cc: Likewise. * testsuite/30_threads/recursive_mutex/unlock/1.cc: Likewise. * testsuite/30_threads/unique_lock/requirements/ explicit_instantiation.cc: Likewise. * testsuite/30_threads/unique_lock/requirements/typedefs.cc: Likewise. * testsuite/30_threads/mutex/cons/assign_neg.cc: Also adjust dg-error lines for deleted members. * testsuite/30_threads/mutex/cons/copy_neg.cc: Likewise. * testsuite/30_threads/recursive_mutex/cons/assign_neg.cc: Likewise. * testsuite/30_threads/recursive_mutex/cons/copy_neg.cc: Likewise. * testsuite/30_threads/call_once/once_flag.cc: New. * testsuite/30_threads/call_once/call_once1.cc: Likewise. * testsuite/30_threads/condition_variable/cons/1.cc: Likewise. * testsuite/30_threads/condition_variable/cons/copy_neg.cc: Likewise * testsuite/30_threads/condition_variable/cons/assign_neg.cc: Likewise. * testsuite/30_threads/condition_variable_any/cons/1.cc: Likewise. * testsuite/30_threads/condition_variable_any/cons/copy_neg.cc: Likewise. * testsuite/30_threads/condition_variable_any/cons/assign_neg.cc: Likewise. * testsuite/30_threads/timed_mutex/dest/destructor_locked.cc: Likewise. * testsuite/30_threads/timed_mutex/native_handle/1.cc: Likewise. * testsuite/30_threads/timed_mutex/try_lock_until/1.cc: Likewise. * testsuite/30_threads/timed_mutex/try_lock_until/2.cc: Likewise. * testsuite/30_threads/timed_mutex/cons/assign_neg.cc: Likewise. * testsuite/30_threads/timed_mutex/cons/1.cc: Likewise. * testsuite/30_threads/timed_mutex/cons/copy_neg.cc: Likewise. * testsuite/30_threads/timed_mutex/requirements/typedefs.cc: Likewise. * testsuite/30_threads/timed_mutex/try_lock/1.cc: Likewise. * testsuite/30_threads/timed_mutex/try_lock/2.cc: Likewise. * testsuite/30_threads/timed_mutex/lock/1.cc: Likewise. * testsuite/30_threads/timed_mutex/unlock/1.cc: Likewise. * testsuite/30_threads/timed_mutex/try_lock_for/1.cc: Likewise. * testsuite/30_threads/timed_mutex/try_lock_for/2.cc: Likewise. * testsuite/30_threads/timed_mutex/try_lock_for/3.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/dest/destructor_locked.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/try_lock_until/1.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/try_lock_until/2.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/native_handle/1.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/cons: Likewise. * testsuite/30_threads/recursive_timed_mutex/cons/assign_neg.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/cons/1.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/cons/copy_neg.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/requirements/typedefs.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/try_lock/1.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/try_lock/2.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/lock/1.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/lock/2.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/unlock/1.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/try_lock_for/1.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/try_lock_for/2.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/try_lock_for/3.cc: Likewise. * testsuite/30_threads/unique_lock/modifiers/1.cc: Likewise. * testsuite/30_threads/unique_lock/modifiers/2.cc: Likewise. * testsuite/30_threads/unique_lock/cons/1.cc: Likewise. * testsuite/30_threads/unique_lock/cons/2.cc: Likewise. * testsuite/30_threads/unique_lock/cons/3.cc: Likewise. * testsuite/30_threads/unique_lock/cons/4.cc: Likewise. * testsuite/30_threads/unique_lock/cons/5.cc: Likewise. * testsuite/30_threads/unique_lock/cons/6.cc: Likewise. * testsuite/30_threads/unique_lock/locking/1.cc: Likewise. * testsuite/30_threads/unique_lock/locking/2.cc: Likewise. * testsuite/30_threads/unique_lock/locking/3.cc: Likewise. * testsuite/30_threads/unique_lock/locking/4.cc: Likewise. From-SVN: r139943
2008-09-03 19:46:09 +02:00
#include <chrono>
condition_variable: New. 2008-05-06 Benjamin Kosnik <bkoz@redhat.com> * include/std/condition_variable: New. * include/std/mutex: New. * src/condition_variable.cc: New. * src/mutex.cc: New. * include/bits/functexcept.h: Add __throw_system_error varients. * src/functexcept.cc: Same. * config/abi/pre/gnu.ver: Add exports. * doc/xml/manual/using.xml: Add new includes. * doc/doxygen/user.cfg.in: Doxygen support. * doc/doxygen/doxygroups.cc: Same. * include/Makefile.am: Add mutex, condition_variable. * include/Makefile.in: Regenerated. * src/Makefile.am: Add mutex.cc, condition_variable.cc. * src/Makefile.in: Regenerated. * testsuite/30_threads: New. * testsuite/30_threads/lock_error: New. * testsuite/30_threads/mutex: New. * testsuite/30_threads/mutex/dest: New. * testsuite/30_threads/mutex/dest/destructor_locked.cc: New. * testsuite/30_threads/mutex/native_handle: New. * testsuite/30_threads/mutex/native_handle/1.cc: New. * testsuite/30_threads/mutex/cons: New. * testsuite/30_threads/mutex/cons/assign_neg.cc: New. * testsuite/30_threads/mutex/cons/1.cc: New. * testsuite/30_threads/mutex/cons/copy_neg.cc: New. * testsuite/30_threads/mutex/requirements: New. * testsuite/30_threads/mutex/requirements/typedefs.cc: New. * testsuite/30_threads/mutex/try_lock: New. * testsuite/30_threads/mutex/try_lock/1.cc: New. * testsuite/30_threads/mutex/try_lock/2.cc: New. * testsuite/30_threads/mutex/lock: New. * testsuite/30_threads/mutex/lock/1.cc: New. * testsuite/30_threads/mutex/unlock: New. * testsuite/30_threads/mutex/unlock/1.cc: New. * testsuite/30_threads/recursive_mutex: New. * testsuite/30_threads/recursive_mutex/dest: New. * testsuite/30_threads/recursive_mutex/dest/destructor_locked.cc: New. * testsuite/30_threads/recursive_mutex/native_handle: New. * testsuite/30_threads/recursive_mutex/native_handle/1.cc: New. * testsuite/30_threads/recursive_mutex/cons: New. * testsuite/30_threads/recursive_mutex/cons/assign_neg.cc: New. * testsuite/30_threads/recursive_mutex/cons/1.cc: New. * testsuite/30_threads/recursive_mutex/cons/copy_neg.cc: New. * testsuite/30_threads/recursive_mutex/requirements: New. * testsuite/30_threads/recursive_mutex/requirements/typedefs.cc: New. * testsuite/30_threads/lock_guard: New. * testsuite/30_threads/lock_guard/requirements: New. * testsuite/30_threads/lock_guard/requirements/typedefs.cc: New. * testsuite/30_threads/lock_guard/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/headers: New. * testsuite/30_threads/headers/mutex: New. * testsuite/30_threads/headers/mutex/types_std_c++0x.cc: New. * testsuite/30_threads/headers/mutex/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/condition_variable: New. * testsuite/30_threads/headers/condition_variable/ types_std_c++0x.cc: New. * testsuite/30_threads/headers/condition_variable/std_c++0x_neg.cc: New. * testsuite/30_threads/once_flag: New. * testsuite/30_threads/unique_lock: New. * testsuite/30_threads/unique_lock/requirements: New. * testsuite/30_threads/unique_lock/requirements/typedefs.cc: New. * testsuite/30_threads/unique_lock/requirements/ explicit_instantiation.cc: New. * testsuite/17_intro/headers/c++200x/all.cc: Add new includes. From-SVN: r135007
2008-05-06 23:11:47 +02:00
#include <mutex> // unique_lock
condition_variable: Use new deleted ctors. 2008-09-03 Chris Fairles <chris.fairles@gmail.com> * include/std/condition_variable: Use new deleted ctors. * include/std/mutex: Likewise plus implement timed_mutex, recursive_timed_mutex and call_once. * src/condition_variable.cc: Implement wait(). Use gthread types. Remove _GTHREADS_HAS_COND checks in favor of global _GLIBCXX_HAS_GTHREADS. * src/mutex.cc (call_once): Implementation using TLS with mutex fallback. * config/abi/pre/gnu.ver: Add exported symbols. * testsuite/lib/libstdc++.exp (check_v3_target_gthreads): New. * testsuite/lib/dg-options.exp (dg-require-gthreads): Likewise. * testsuite/30_threads/lock_guard/requirements/typedefs.cc: Use dg-require-gthreads and dg-require-cstdint. * testsuite/30_threads/lock_guard/requirements/ explicit_instantiation.cc: Likewise. * testsuite/30_threads/mutex/dest/destructor_locked.cc: Likewise. * testsuite/30_threads/mutex/native_handle/1.cc: Likewise. * testsuite/30_threads/mutex/cons/1.cc: Likewise. * testsuite/30_threads/mutex/requirements/typedefs.cc: Likewise. * testsuite/30_threads/mutex/try_lock/1.cc: Likewise. * testsuite/30_threads/mutex/try_lock/2.cc: Likewise. * testsuite/30_threads/mutex/lock/1.cc: Likewise. * testsuite/30_threads/mutex/unlock/1.cc: Likewise. * testsuite/30_threads/recursive_mutex/dest/destructor_locked.cc: Likewise. * testsuite/30_threads/recursive_mutex/native_handle/1.cc: Likewise. * testsuite/30_threads/recursive_mutex/cons/1.cc: Likewise. * testsuite/30_threads/recursive_mutex/requirements/typedefs.cc: Likewise. * testsuite/30_threads/recursive_mutex/try_lock/1.cc: Likewise. * testsuite/30_threads/recursive_mutex/try_lock/2.cc: Likewise. * testsuite/30_threads/recursive_mutex/lock/1.cc: Likewise. * testsuite/30_threads/recursive_mutex/unlock/1.cc: Likewise. * testsuite/30_threads/unique_lock/requirements/ explicit_instantiation.cc: Likewise. * testsuite/30_threads/unique_lock/requirements/typedefs.cc: Likewise. * testsuite/30_threads/mutex/cons/assign_neg.cc: Also adjust dg-error lines for deleted members. * testsuite/30_threads/mutex/cons/copy_neg.cc: Likewise. * testsuite/30_threads/recursive_mutex/cons/assign_neg.cc: Likewise. * testsuite/30_threads/recursive_mutex/cons/copy_neg.cc: Likewise. * testsuite/30_threads/call_once/once_flag.cc: New. * testsuite/30_threads/call_once/call_once1.cc: Likewise. * testsuite/30_threads/condition_variable/cons/1.cc: Likewise. * testsuite/30_threads/condition_variable/cons/copy_neg.cc: Likewise * testsuite/30_threads/condition_variable/cons/assign_neg.cc: Likewise. * testsuite/30_threads/condition_variable_any/cons/1.cc: Likewise. * testsuite/30_threads/condition_variable_any/cons/copy_neg.cc: Likewise. * testsuite/30_threads/condition_variable_any/cons/assign_neg.cc: Likewise. * testsuite/30_threads/timed_mutex/dest/destructor_locked.cc: Likewise. * testsuite/30_threads/timed_mutex/native_handle/1.cc: Likewise. * testsuite/30_threads/timed_mutex/try_lock_until/1.cc: Likewise. * testsuite/30_threads/timed_mutex/try_lock_until/2.cc: Likewise. * testsuite/30_threads/timed_mutex/cons/assign_neg.cc: Likewise. * testsuite/30_threads/timed_mutex/cons/1.cc: Likewise. * testsuite/30_threads/timed_mutex/cons/copy_neg.cc: Likewise. * testsuite/30_threads/timed_mutex/requirements/typedefs.cc: Likewise. * testsuite/30_threads/timed_mutex/try_lock/1.cc: Likewise. * testsuite/30_threads/timed_mutex/try_lock/2.cc: Likewise. * testsuite/30_threads/timed_mutex/lock/1.cc: Likewise. * testsuite/30_threads/timed_mutex/unlock/1.cc: Likewise. * testsuite/30_threads/timed_mutex/try_lock_for/1.cc: Likewise. * testsuite/30_threads/timed_mutex/try_lock_for/2.cc: Likewise. * testsuite/30_threads/timed_mutex/try_lock_for/3.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/dest/destructor_locked.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/try_lock_until/1.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/try_lock_until/2.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/native_handle/1.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/cons: Likewise. * testsuite/30_threads/recursive_timed_mutex/cons/assign_neg.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/cons/1.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/cons/copy_neg.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/requirements/typedefs.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/try_lock/1.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/try_lock/2.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/lock/1.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/lock/2.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/unlock/1.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/try_lock_for/1.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/try_lock_for/2.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/try_lock_for/3.cc: Likewise. * testsuite/30_threads/unique_lock/modifiers/1.cc: Likewise. * testsuite/30_threads/unique_lock/modifiers/2.cc: Likewise. * testsuite/30_threads/unique_lock/cons/1.cc: Likewise. * testsuite/30_threads/unique_lock/cons/2.cc: Likewise. * testsuite/30_threads/unique_lock/cons/3.cc: Likewise. * testsuite/30_threads/unique_lock/cons/4.cc: Likewise. * testsuite/30_threads/unique_lock/cons/5.cc: Likewise. * testsuite/30_threads/unique_lock/cons/6.cc: Likewise. * testsuite/30_threads/unique_lock/locking/1.cc: Likewise. * testsuite/30_threads/unique_lock/locking/2.cc: Likewise. * testsuite/30_threads/unique_lock/locking/3.cc: Likewise. * testsuite/30_threads/unique_lock/locking/4.cc: Likewise. From-SVN: r139943
2008-09-03 19:46:09 +02:00
#if defined(_GLIBCXX_HAS_GTHREADS) && defined(_GLIBCXX_USE_C99_STDINT_TR1)
PR libstdc++/36104 part four 2011-01-30 Benjamin Kosnik <bkoz@redhat.com> PR libstdc++/36104 part four * include/bits/c++config (_GLIBCXX_STD): Remove. (_GLIBCXX_STD_D, _GLIBCXX_PR): Now _GLIBCXX_STD_C. (_GLIBCXX_P): Now _GLIBCXX_STD_A. (_GLIBCXX_NAMESPACE_DEBUG, _GLIBCXX_NAMESPACE_PARALLEL, _GLIBCXX_NAMESPACE_PROFILE, _GLIBCXX_NAMESPACE_VERSION): Remove. (_GLIBCXX_INLINE_DEBUG, _GLIBCXX_INLINE_PARALLEL, _GLIBCXX_INLINE_PROFILE): Remove. (_GLIBCXX_BEGIN_NAMESPACE(X)): Remove. (_GLIBCXX_END_NAMESPACE): Remove. (_GLIBCXX_BEGIN_NESTED_NAMESPACE(X, Y)): Remove. (_GLIBCXX_END_NESTED_NAMESPACE): Remove. (_GLIBCXX_BEGIN_NAMESPACE_ALGO): Add. (_GLIBCXX_END_NAMESPACE_ALGO): Add. (_GLIBCXX_BEGIN_NAMESPACE_CONTAINER): Add. (_GLIBCXX_END_NAMESPACE_CONTAINER): Add. (_GLIBCXX_BEGIN_NAMESPACE_VERSION): Add. (_GLIBCXX_END_NAMESPACE_VERSION): Add. (_GLIBCXX_BEGIN_LDBL_NAMESPACE): To _GLIBCXX_BEGIN_NAMESPACE_LDBL. (_GLIBCXX_END_LDBL_NAMESPACE): To _GLIBCXX_END_NAMESPACE_LDBL. (_GLIBCXX_VISIBILITY_ATTR): Revert to _GLIBCXX_VISIBILITY. * include/*: Use new macros for namespace scope. * config/*: Same. * src/*: Same. * src/Makefile.am (sources): Remove debug_list.cc, add compatibility-debug_list-2.cc. (parallel_sources): Remove parallel_list.cc, add compatibility-parallel_list-2.cc. (compatibility-parallel_list-2.[o,lo]): New rule. * src/Makefile.in: Regenerate. * src/debug_list.cc: Remove. * src/parallel_list.cc: Remove. * src/compatibility-list-2.cc: New. * src/compatibility-debug_list-2.cc: New. * src/compatibility-parallel_list-2.cc: New. * doc/doxygen/user.cfg.in: Adjust macros. * testsuite/20_util/auto_ptr/assign_neg.cc: Adjust line numbers, macros. * testsuite/20_util/declval/requirements/1_neg.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg1.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg2.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg3.cc: Same. * testsuite/20_util/forward/c_neg.cc: Same. * testsuite/20_util/forward/f_neg.cc: Same. * testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Same. * testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc: Same. * testsuite/20_util/ratio/cons/cons_overflow_neg.cc: Same. * testsuite/20_util/ratio/operations/ops_overflow_neg.cc: Same. * testsuite/20_util/shared_ptr/cons/43820_neg.cc: Same. * testsuite/20_util/weak_ptr/comparison/cmp_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/insert_neg.cc: Same. * testsuite/23_containers/forward_list/capacity/1.cc: Same. * testsuite/23_containers/forward_list/requirements/dr438/ assign_neg.cc: Same. * testsuite/23_containers/forward_list/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/forward_list/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/forward_list/requirements/dr438/ insert_neg.cc: Same. * testsuite/23_containers/list/capacity/29134.cc: Same. * testsuite/23_containers/list/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/insert_neg.cc: Same. * testsuite/23_containers/vector/bool/capacity/29134.cc: Same. * testsuite/23_containers/vector/bool/modifiers/insert/31370.cc: Same. * testsuite/23_containers/vector/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/insert_neg.cc: Same. * testsuite/25_algorithms/sort/35588.cc: Same. * testsuite/27_io/ios_base/cons/assign_neg.cc: Same. * testsuite/27_io/ios_base/cons/copy_neg.cc: Same. * testsuite/ext/profile/mutex_extensions_neg.cc: Same. * testsuite/ext/profile/profiler_algos.cc: Same. * testsuite/ext/type_traits/add_unsigned_floating_neg.cc: Same. * testsuite/ext/type_traits/add_unsigned_integer_neg.cc: Same. * testsuite/ext/type_traits/remove_unsigned_floating_neg.cc: Same. * testsuite/ext/type_traits/remove_unsigned_integer_neg.cc: Same. * testsuite/tr1/2_general_utilities/shared_ptr/cons/43820_neg.cc: Same. From-SVN: r169421
2011-01-30 23:39:36 +01:00
namespace std _GLIBCXX_VISIBILITY(default)
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
cinttypes: Remove, move contents to C++0x and TR1 headers. 2010-11-02 Paolo Carlini <paolo.carlini@oracle.com> * include/tr1_impl/cinttypes: Remove, move contents to C++0x and TR1 headers. * include/tr1_impl/cstdlib: Likewise. * include/tr1_impl/cstdio: Likewise. * include/tr1_impl/cctype: Likewise. * include/tr1_impl/boost_sp_counted_base.h: Likewise. * include/tr1_impl/cmath: Likewise. * include/tr1_impl/cfenv: Likewise. * include/tr1_impl/utility: Likewise. * include/tr1_impl/complex: Likewise. * include/tr1_impl/cwchar: Likewise. * include/tr1_impl/type_traits: Likewise. * include/tr1_impl/cstdint: Likewise. * include/tr1_impl/regex: Likewise. * include/tr1_impl/array: Likewise. * include/tr1_impl/cwctype: Likewise. * include/Makefile.am: Adjust. * include/Makefile.in: Regenerate. * src/condition_variable.cc: Adjust; consistently use _GLIBCXX_BEGIN_NAMESPACE and _GLIBCXX_END_NAMESPACE. * src/mutex.cc: Likewise. * src/future.cc: Likewise. * src/atomic.cc: Likewise. * src/chrono.cc: Likewise. * src/thread.cc: Likewise. * include/std/tuple: Likewise. * include/std/utility: Likewise. * include/std/thread: Likewise.: Likewise. * include/std/type_traits: Likewise. * include/std/memory: Likewise. * include/std/future: Likewise. * include/std/ratio: Likewise. * include/std/chrono: Likewise. * include/std/condition_variable: Likewise. * include/std/mutex: Likewise. * include/std/functional: Likewise. * include/std/complex: Likewise. * include/std/typeindex: Likewise. * include/std/array: Likewise. * include/bits/regex_compiler.h: Likewise. * include/bits/regex_grep_matcher.tcc: Likewise. * include/bits/regex_grep_matcher.h: Likewise. * include/bits/regex_constants.h: Likewise. * include/bits/regex_cursor.h: Likewise. * include/bits/regex_nfa.tcc: Likewise. * include/bits/shared_ptr_base.h: Likewise. * include/bits/regex_nfa.h: Likewise. * include/bits/random.tcc: Likewise. * include/bits/regex.h: Likewise. * include/bits/random.h: Likewise. * include/bits/regex_error.h: Likewise. * include/c_global/cinttypes: Likewise. * include/c_global/cstdlib: Likewise. * include/c_global/cstdio: Likewise. * include/c_global/cctype: Likewise. * include/c_global/cmath: Likewise. * include/c_global/cfenv: Likewise. * include/c_global/cwchar: Likewise. * include/c_global/cstdint: Likewise. * include/c_global/cwctype: Likewise. * include/tr1/shared_ptr.h: Likewise. * include/tr1/cinttypes: Likewise. * include/tr1/cstdio: Likewise. * include/tr1/cfenv: Likewise. * include/tr1/utility: Likewise. * include/tr1/cwchar: Likewise. * include/tr1/type_traits: Likewise. * include/tr1/memory: Likewise. * include/tr1/cstdint: Likewise. * include/tr1/regex: Likewise. * include/tr1/cwctype: Likewise. * include/tr1/cstdlib: Likewise. * include/tr1/cctype: Likewise. * include/tr1/cmath: Likewise. * include/tr1/complex: Likewise. * include/tr1/array: Likewise. * include/c_compatibility/fenv.h: Likewise. * include/c_compatibility/stdint.h: Likewise. * include/c_compatibility/inttypes.h: Likewise. * testsuite/tr1/2_general_utilities/shared_ptr/cons/43820.cc: Adjust dg-error line numbers. * testsuite/20_util/duration/requirements/typedefs_neg1.cc: Likewise. * testsuite/20_util/duration/requirements/typedefs_neg2.cc: Likewise. * testsuite/20_util/duration/requirements/typedefs_neg3.cc: Likewise. * testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Likewise. * testsuite/20_util/make_unsigned/requirements/ typedefs_neg.cc: Likewise. * testsuite/20_util/declval/requirements/1_neg.cc: Likewise. * testsuite/20_util/shared_ptr/cons/43820.cc: Likewise. * testsuite/20_util/weak_ptr/comparison/cmp_neg.cc: Likewise. From-SVN: r166211
2010-11-02 19:51:23 +01:00
user.cfg.in: Tweaks. 2009-02-20 Benjamin Kosnik <bkoz@redhat.com> * doc/doxygen/user.cfg.in: Tweaks. * doc/doxygen/doxygroups.cc: Prefer markup that can be elsewhere, be elsewhere. * include/tr1_impl/unordered_map: Just use most specialized container module. * include/tr1_impl/unordered_set: Same. * include/tr1_impl/array: Same. * include/bits/stl_list.h: Same. * include/bits/stl_map.h: Same. * include/bits/stl_queue.h: Same. * include/bits/stl_set.h: Same. * include/bits/stl_stack.h: Same. * include/bits/forward_list.h: Same. * include/bits/basic_string.h: Same. * include/bits/stl_multimap.h: Same. * include/bits/stl_vector.h: Same. * include/bits/stl_deque.h: Same. * include/bits/stl_multiset.h: Same. * include/bits/stl_bvector.h: Same. * include/backward/binders.h: Change binder module to binders. * include/std/complex: Add complex_numers module. * include/tr1_impl/complex: Same. * include/std/valarray: Add numeric_arrays module. * include/bits/gslice_array.h: Same. * include/bits/gslice.h: Same. * include/bits/mask_array.h: Same. * include/bits/slice_array.h: Same. * include/bits/indirect_array.h: Same. * include/bits/allocator.h: Add allocators module. * include/ext/throw_allocator.h * include/ext/pool_allocator.h * include/ext/bitmap_allocator.h * include/ext/new_allocator.h * include/ext/malloc_allocator.h * include/ext/array_allocator.h * include/ext/mt_allocator.h * include/ext/debug_allocator.h * include/ext/extptr_allocator.h * include/tr1_impl/functional: Move namespace markup here. * include/tr1_impl/regex: Same. * include/tr1_impl/type_traits: Add metaprogramming module. * include/std/type_traits: Same. * include/std/memory: Add memory module. * include/std/ratio: Add ratio module. * include/std/chrono: Move namespace markup here, add time module. * include/std/thread: Move namespace markup here, add concurrency module. * include/std/mutex: Use concurrency module. * include/std/condition_variable: Same. * include/bits/ios_base.h: Refine io module. * include/bits/basic_ios.h: Same. * include/std/fstream: Same. * include/std/istream: Same. * include/std/ostream: Same. * include/std/sstream: Same. * include/ext/vstring.h: Correct parameter markup. * include/bits/shared_ptr.h: Add pointer_abstractions module. * include/bits/unique_ptr.h: Same. * include/bits/algorithmfwd.h: Add mutating_algorithms, non_mutating_algorithms, sorting_algorithms. Adjust nesting. * include/bits/stl_heap.h: Add markup for new groupings. * include/bits/stl_algobase.h: Same. * include/bits/stl_algo.h: Same. * include/c_compatibility/stdatomic.h: Add atomics module. * include/c_global/cstdatomic: Same. * libsupc++/exception: Add exceptions module. * libsupc++/typeinfo: Same. * libsupc++/new: Same. * libsupc++/exception_ptr.h: Same. * include/std/system_error: Same. * include/std/stdexcept: Same. * libsupc++/cxxabi.h: Move doxygroups.cc markup here. * libsupc++/cxxabi-forced.h: Same. * testsuite/27_io/ios_base/cons/assign_neg.cc: Fix up line numbers. * testsuite/27_io/ios_base/cons/copy_neg.cc: Same. * testsuite/30_threads/condition_variable_any/cons/assign_neg.cc: Same. * 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/29_atomics/atomic/cons/assign_neg.cc: Same. * testsuite/29_atomics/atomic/cons/copy_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/insert_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/insert_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/insert_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/20_util/duration/cons/1_neg.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg1.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg2.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg3.cc: Same. * testsuite/20_util/unique_ptr/modifiers/reset_neg.cc: Same. * testsuite/20_util/unique_ptr/assign/assign.cc: Same. * testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Same. * testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc: Same. * testsuite/20_util/ratio/cons/cons_overflow.cc: Same. * testsuite/20_util/ratio/operations/ops_overflow.cc: Same. From-SVN: r144343
2009-02-21 01:45:21 +01:00
/**
* @defgroup condition_variables Condition Variables
* @ingroup concurrency
*
* Classes for condition_variable support.
* @{
*/
/// cv_status
enum class cv_status { no_timeout, timeout };
condition_variable: New. 2008-05-06 Benjamin Kosnik <bkoz@redhat.com> * include/std/condition_variable: New. * include/std/mutex: New. * src/condition_variable.cc: New. * src/mutex.cc: New. * include/bits/functexcept.h: Add __throw_system_error varients. * src/functexcept.cc: Same. * config/abi/pre/gnu.ver: Add exports. * doc/xml/manual/using.xml: Add new includes. * doc/doxygen/user.cfg.in: Doxygen support. * doc/doxygen/doxygroups.cc: Same. * include/Makefile.am: Add mutex, condition_variable. * include/Makefile.in: Regenerated. * src/Makefile.am: Add mutex.cc, condition_variable.cc. * src/Makefile.in: Regenerated. * testsuite/30_threads: New. * testsuite/30_threads/lock_error: New. * testsuite/30_threads/mutex: New. * testsuite/30_threads/mutex/dest: New. * testsuite/30_threads/mutex/dest/destructor_locked.cc: New. * testsuite/30_threads/mutex/native_handle: New. * testsuite/30_threads/mutex/native_handle/1.cc: New. * testsuite/30_threads/mutex/cons: New. * testsuite/30_threads/mutex/cons/assign_neg.cc: New. * testsuite/30_threads/mutex/cons/1.cc: New. * testsuite/30_threads/mutex/cons/copy_neg.cc: New. * testsuite/30_threads/mutex/requirements: New. * testsuite/30_threads/mutex/requirements/typedefs.cc: New. * testsuite/30_threads/mutex/try_lock: New. * testsuite/30_threads/mutex/try_lock/1.cc: New. * testsuite/30_threads/mutex/try_lock/2.cc: New. * testsuite/30_threads/mutex/lock: New. * testsuite/30_threads/mutex/lock/1.cc: New. * testsuite/30_threads/mutex/unlock: New. * testsuite/30_threads/mutex/unlock/1.cc: New. * testsuite/30_threads/recursive_mutex: New. * testsuite/30_threads/recursive_mutex/dest: New. * testsuite/30_threads/recursive_mutex/dest/destructor_locked.cc: New. * testsuite/30_threads/recursive_mutex/native_handle: New. * testsuite/30_threads/recursive_mutex/native_handle/1.cc: New. * testsuite/30_threads/recursive_mutex/cons: New. * testsuite/30_threads/recursive_mutex/cons/assign_neg.cc: New. * testsuite/30_threads/recursive_mutex/cons/1.cc: New. * testsuite/30_threads/recursive_mutex/cons/copy_neg.cc: New. * testsuite/30_threads/recursive_mutex/requirements: New. * testsuite/30_threads/recursive_mutex/requirements/typedefs.cc: New. * testsuite/30_threads/lock_guard: New. * testsuite/30_threads/lock_guard/requirements: New. * testsuite/30_threads/lock_guard/requirements/typedefs.cc: New. * testsuite/30_threads/lock_guard/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/headers: New. * testsuite/30_threads/headers/mutex: New. * testsuite/30_threads/headers/mutex/types_std_c++0x.cc: New. * testsuite/30_threads/headers/mutex/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/condition_variable: New. * testsuite/30_threads/headers/condition_variable/ types_std_c++0x.cc: New. * testsuite/30_threads/headers/condition_variable/std_c++0x_neg.cc: New. * testsuite/30_threads/once_flag: New. * testsuite/30_threads/unique_lock: New. * testsuite/30_threads/unique_lock/requirements: New. * testsuite/30_threads/unique_lock/requirements/typedefs.cc: New. * testsuite/30_threads/unique_lock/requirements/ explicit_instantiation.cc: New. * testsuite/17_intro/headers/c++200x/all.cc: Add new includes. From-SVN: r135007
2008-05-06 23:11:47 +02:00
/// condition_variable
class condition_variable
{
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
2009-02-10 09:29:57 +01:00
typedef chrono::system_clock __clock_t;
typedef __gthread_cond_t __native_type;
#ifdef __GTHREAD_COND_INIT
__native_type _M_cond = __GTHREAD_COND_INIT;
#else
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
2009-02-10 09:29:57 +01:00
__native_type _M_cond;
#endif
condition_variable: New. 2008-05-06 Benjamin Kosnik <bkoz@redhat.com> * include/std/condition_variable: New. * include/std/mutex: New. * src/condition_variable.cc: New. * src/mutex.cc: New. * include/bits/functexcept.h: Add __throw_system_error varients. * src/functexcept.cc: Same. * config/abi/pre/gnu.ver: Add exports. * doc/xml/manual/using.xml: Add new includes. * doc/doxygen/user.cfg.in: Doxygen support. * doc/doxygen/doxygroups.cc: Same. * include/Makefile.am: Add mutex, condition_variable. * include/Makefile.in: Regenerated. * src/Makefile.am: Add mutex.cc, condition_variable.cc. * src/Makefile.in: Regenerated. * testsuite/30_threads: New. * testsuite/30_threads/lock_error: New. * testsuite/30_threads/mutex: New. * testsuite/30_threads/mutex/dest: New. * testsuite/30_threads/mutex/dest/destructor_locked.cc: New. * testsuite/30_threads/mutex/native_handle: New. * testsuite/30_threads/mutex/native_handle/1.cc: New. * testsuite/30_threads/mutex/cons: New. * testsuite/30_threads/mutex/cons/assign_neg.cc: New. * testsuite/30_threads/mutex/cons/1.cc: New. * testsuite/30_threads/mutex/cons/copy_neg.cc: New. * testsuite/30_threads/mutex/requirements: New. * testsuite/30_threads/mutex/requirements/typedefs.cc: New. * testsuite/30_threads/mutex/try_lock: New. * testsuite/30_threads/mutex/try_lock/1.cc: New. * testsuite/30_threads/mutex/try_lock/2.cc: New. * testsuite/30_threads/mutex/lock: New. * testsuite/30_threads/mutex/lock/1.cc: New. * testsuite/30_threads/mutex/unlock: New. * testsuite/30_threads/mutex/unlock/1.cc: New. * testsuite/30_threads/recursive_mutex: New. * testsuite/30_threads/recursive_mutex/dest: New. * testsuite/30_threads/recursive_mutex/dest/destructor_locked.cc: New. * testsuite/30_threads/recursive_mutex/native_handle: New. * testsuite/30_threads/recursive_mutex/native_handle/1.cc: New. * testsuite/30_threads/recursive_mutex/cons: New. * testsuite/30_threads/recursive_mutex/cons/assign_neg.cc: New. * testsuite/30_threads/recursive_mutex/cons/1.cc: New. * testsuite/30_threads/recursive_mutex/cons/copy_neg.cc: New. * testsuite/30_threads/recursive_mutex/requirements: New. * testsuite/30_threads/recursive_mutex/requirements/typedefs.cc: New. * testsuite/30_threads/lock_guard: New. * testsuite/30_threads/lock_guard/requirements: New. * testsuite/30_threads/lock_guard/requirements/typedefs.cc: New. * testsuite/30_threads/lock_guard/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/headers: New. * testsuite/30_threads/headers/mutex: New. * testsuite/30_threads/headers/mutex/types_std_c++0x.cc: New. * testsuite/30_threads/headers/mutex/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/condition_variable: New. * testsuite/30_threads/headers/condition_variable/ types_std_c++0x.cc: New. * testsuite/30_threads/headers/condition_variable/std_c++0x_neg.cc: New. * testsuite/30_threads/once_flag: New. * testsuite/30_threads/unique_lock: New. * testsuite/30_threads/unique_lock/requirements: New. * testsuite/30_threads/unique_lock/requirements/typedefs.cc: New. * testsuite/30_threads/unique_lock/requirements/ explicit_instantiation.cc: New. * testsuite/17_intro/headers/c++200x/all.cc: Add new includes. From-SVN: r135007
2008-05-06 23:11:47 +02:00
public:
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
2009-02-10 09:29:57 +01:00
typedef __native_type* native_handle_type;
condition_variable: New. 2008-05-06 Benjamin Kosnik <bkoz@redhat.com> * include/std/condition_variable: New. * include/std/mutex: New. * src/condition_variable.cc: New. * src/mutex.cc: New. * include/bits/functexcept.h: Add __throw_system_error varients. * src/functexcept.cc: Same. * config/abi/pre/gnu.ver: Add exports. * doc/xml/manual/using.xml: Add new includes. * doc/doxygen/user.cfg.in: Doxygen support. * doc/doxygen/doxygroups.cc: Same. * include/Makefile.am: Add mutex, condition_variable. * include/Makefile.in: Regenerated. * src/Makefile.am: Add mutex.cc, condition_variable.cc. * src/Makefile.in: Regenerated. * testsuite/30_threads: New. * testsuite/30_threads/lock_error: New. * testsuite/30_threads/mutex: New. * testsuite/30_threads/mutex/dest: New. * testsuite/30_threads/mutex/dest/destructor_locked.cc: New. * testsuite/30_threads/mutex/native_handle: New. * testsuite/30_threads/mutex/native_handle/1.cc: New. * testsuite/30_threads/mutex/cons: New. * testsuite/30_threads/mutex/cons/assign_neg.cc: New. * testsuite/30_threads/mutex/cons/1.cc: New. * testsuite/30_threads/mutex/cons/copy_neg.cc: New. * testsuite/30_threads/mutex/requirements: New. * testsuite/30_threads/mutex/requirements/typedefs.cc: New. * testsuite/30_threads/mutex/try_lock: New. * testsuite/30_threads/mutex/try_lock/1.cc: New. * testsuite/30_threads/mutex/try_lock/2.cc: New. * testsuite/30_threads/mutex/lock: New. * testsuite/30_threads/mutex/lock/1.cc: New. * testsuite/30_threads/mutex/unlock: New. * testsuite/30_threads/mutex/unlock/1.cc: New. * testsuite/30_threads/recursive_mutex: New. * testsuite/30_threads/recursive_mutex/dest: New. * testsuite/30_threads/recursive_mutex/dest/destructor_locked.cc: New. * testsuite/30_threads/recursive_mutex/native_handle: New. * testsuite/30_threads/recursive_mutex/native_handle/1.cc: New. * testsuite/30_threads/recursive_mutex/cons: New. * testsuite/30_threads/recursive_mutex/cons/assign_neg.cc: New. * testsuite/30_threads/recursive_mutex/cons/1.cc: New. * testsuite/30_threads/recursive_mutex/cons/copy_neg.cc: New. * testsuite/30_threads/recursive_mutex/requirements: New. * testsuite/30_threads/recursive_mutex/requirements/typedefs.cc: New. * testsuite/30_threads/lock_guard: New. * testsuite/30_threads/lock_guard/requirements: New. * testsuite/30_threads/lock_guard/requirements/typedefs.cc: New. * testsuite/30_threads/lock_guard/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/headers: New. * testsuite/30_threads/headers/mutex: New. * testsuite/30_threads/headers/mutex/types_std_c++0x.cc: New. * testsuite/30_threads/headers/mutex/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/condition_variable: New. * testsuite/30_threads/headers/condition_variable/ types_std_c++0x.cc: New. * testsuite/30_threads/headers/condition_variable/std_c++0x_neg.cc: New. * testsuite/30_threads/once_flag: New. * testsuite/30_threads/unique_lock: New. * testsuite/30_threads/unique_lock/requirements: New. * testsuite/30_threads/unique_lock/requirements/typedefs.cc: New. * testsuite/30_threads/unique_lock/requirements/ explicit_instantiation.cc: New. * testsuite/17_intro/headers/c++200x/all.cc: Add new includes. From-SVN: r135007
2008-05-06 23:11:47 +02:00
condition_variable() noexcept;
~condition_variable() noexcept;
condition_variable: New. 2008-05-06 Benjamin Kosnik <bkoz@redhat.com> * include/std/condition_variable: New. * include/std/mutex: New. * src/condition_variable.cc: New. * src/mutex.cc: New. * include/bits/functexcept.h: Add __throw_system_error varients. * src/functexcept.cc: Same. * config/abi/pre/gnu.ver: Add exports. * doc/xml/manual/using.xml: Add new includes. * doc/doxygen/user.cfg.in: Doxygen support. * doc/doxygen/doxygroups.cc: Same. * include/Makefile.am: Add mutex, condition_variable. * include/Makefile.in: Regenerated. * src/Makefile.am: Add mutex.cc, condition_variable.cc. * src/Makefile.in: Regenerated. * testsuite/30_threads: New. * testsuite/30_threads/lock_error: New. * testsuite/30_threads/mutex: New. * testsuite/30_threads/mutex/dest: New. * testsuite/30_threads/mutex/dest/destructor_locked.cc: New. * testsuite/30_threads/mutex/native_handle: New. * testsuite/30_threads/mutex/native_handle/1.cc: New. * testsuite/30_threads/mutex/cons: New. * testsuite/30_threads/mutex/cons/assign_neg.cc: New. * testsuite/30_threads/mutex/cons/1.cc: New. * testsuite/30_threads/mutex/cons/copy_neg.cc: New. * testsuite/30_threads/mutex/requirements: New. * testsuite/30_threads/mutex/requirements/typedefs.cc: New. * testsuite/30_threads/mutex/try_lock: New. * testsuite/30_threads/mutex/try_lock/1.cc: New. * testsuite/30_threads/mutex/try_lock/2.cc: New. * testsuite/30_threads/mutex/lock: New. * testsuite/30_threads/mutex/lock/1.cc: New. * testsuite/30_threads/mutex/unlock: New. * testsuite/30_threads/mutex/unlock/1.cc: New. * testsuite/30_threads/recursive_mutex: New. * testsuite/30_threads/recursive_mutex/dest: New. * testsuite/30_threads/recursive_mutex/dest/destructor_locked.cc: New. * testsuite/30_threads/recursive_mutex/native_handle: New. * testsuite/30_threads/recursive_mutex/native_handle/1.cc: New. * testsuite/30_threads/recursive_mutex/cons: New. * testsuite/30_threads/recursive_mutex/cons/assign_neg.cc: New. * testsuite/30_threads/recursive_mutex/cons/1.cc: New. * testsuite/30_threads/recursive_mutex/cons/copy_neg.cc: New. * testsuite/30_threads/recursive_mutex/requirements: New. * testsuite/30_threads/recursive_mutex/requirements/typedefs.cc: New. * testsuite/30_threads/lock_guard: New. * testsuite/30_threads/lock_guard/requirements: New. * testsuite/30_threads/lock_guard/requirements/typedefs.cc: New. * testsuite/30_threads/lock_guard/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/headers: New. * testsuite/30_threads/headers/mutex: New. * testsuite/30_threads/headers/mutex/types_std_c++0x.cc: New. * testsuite/30_threads/headers/mutex/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/condition_variable: New. * testsuite/30_threads/headers/condition_variable/ types_std_c++0x.cc: New. * testsuite/30_threads/headers/condition_variable/std_c++0x_neg.cc: New. * testsuite/30_threads/once_flag: New. * testsuite/30_threads/unique_lock: New. * testsuite/30_threads/unique_lock/requirements: New. * testsuite/30_threads/unique_lock/requirements/typedefs.cc: New. * testsuite/30_threads/unique_lock/requirements/ explicit_instantiation.cc: New. * testsuite/17_intro/headers/c++200x/all.cc: Add new includes. From-SVN: r135007
2008-05-06 23:11:47 +02:00
condition_variable: Use new deleted ctors. 2008-09-03 Chris Fairles <chris.fairles@gmail.com> * include/std/condition_variable: Use new deleted ctors. * include/std/mutex: Likewise plus implement timed_mutex, recursive_timed_mutex and call_once. * src/condition_variable.cc: Implement wait(). Use gthread types. Remove _GTHREADS_HAS_COND checks in favor of global _GLIBCXX_HAS_GTHREADS. * src/mutex.cc (call_once): Implementation using TLS with mutex fallback. * config/abi/pre/gnu.ver: Add exported symbols. * testsuite/lib/libstdc++.exp (check_v3_target_gthreads): New. * testsuite/lib/dg-options.exp (dg-require-gthreads): Likewise. * testsuite/30_threads/lock_guard/requirements/typedefs.cc: Use dg-require-gthreads and dg-require-cstdint. * testsuite/30_threads/lock_guard/requirements/ explicit_instantiation.cc: Likewise. * testsuite/30_threads/mutex/dest/destructor_locked.cc: Likewise. * testsuite/30_threads/mutex/native_handle/1.cc: Likewise. * testsuite/30_threads/mutex/cons/1.cc: Likewise. * testsuite/30_threads/mutex/requirements/typedefs.cc: Likewise. * testsuite/30_threads/mutex/try_lock/1.cc: Likewise. * testsuite/30_threads/mutex/try_lock/2.cc: Likewise. * testsuite/30_threads/mutex/lock/1.cc: Likewise. * testsuite/30_threads/mutex/unlock/1.cc: Likewise. * testsuite/30_threads/recursive_mutex/dest/destructor_locked.cc: Likewise. * testsuite/30_threads/recursive_mutex/native_handle/1.cc: Likewise. * testsuite/30_threads/recursive_mutex/cons/1.cc: Likewise. * testsuite/30_threads/recursive_mutex/requirements/typedefs.cc: Likewise. * testsuite/30_threads/recursive_mutex/try_lock/1.cc: Likewise. * testsuite/30_threads/recursive_mutex/try_lock/2.cc: Likewise. * testsuite/30_threads/recursive_mutex/lock/1.cc: Likewise. * testsuite/30_threads/recursive_mutex/unlock/1.cc: Likewise. * testsuite/30_threads/unique_lock/requirements/ explicit_instantiation.cc: Likewise. * testsuite/30_threads/unique_lock/requirements/typedefs.cc: Likewise. * testsuite/30_threads/mutex/cons/assign_neg.cc: Also adjust dg-error lines for deleted members. * testsuite/30_threads/mutex/cons/copy_neg.cc: Likewise. * testsuite/30_threads/recursive_mutex/cons/assign_neg.cc: Likewise. * testsuite/30_threads/recursive_mutex/cons/copy_neg.cc: Likewise. * testsuite/30_threads/call_once/once_flag.cc: New. * testsuite/30_threads/call_once/call_once1.cc: Likewise. * testsuite/30_threads/condition_variable/cons/1.cc: Likewise. * testsuite/30_threads/condition_variable/cons/copy_neg.cc: Likewise * testsuite/30_threads/condition_variable/cons/assign_neg.cc: Likewise. * testsuite/30_threads/condition_variable_any/cons/1.cc: Likewise. * testsuite/30_threads/condition_variable_any/cons/copy_neg.cc: Likewise. * testsuite/30_threads/condition_variable_any/cons/assign_neg.cc: Likewise. * testsuite/30_threads/timed_mutex/dest/destructor_locked.cc: Likewise. * testsuite/30_threads/timed_mutex/native_handle/1.cc: Likewise. * testsuite/30_threads/timed_mutex/try_lock_until/1.cc: Likewise. * testsuite/30_threads/timed_mutex/try_lock_until/2.cc: Likewise. * testsuite/30_threads/timed_mutex/cons/assign_neg.cc: Likewise. * testsuite/30_threads/timed_mutex/cons/1.cc: Likewise. * testsuite/30_threads/timed_mutex/cons/copy_neg.cc: Likewise. * testsuite/30_threads/timed_mutex/requirements/typedefs.cc: Likewise. * testsuite/30_threads/timed_mutex/try_lock/1.cc: Likewise. * testsuite/30_threads/timed_mutex/try_lock/2.cc: Likewise. * testsuite/30_threads/timed_mutex/lock/1.cc: Likewise. * testsuite/30_threads/timed_mutex/unlock/1.cc: Likewise. * testsuite/30_threads/timed_mutex/try_lock_for/1.cc: Likewise. * testsuite/30_threads/timed_mutex/try_lock_for/2.cc: Likewise. * testsuite/30_threads/timed_mutex/try_lock_for/3.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/dest/destructor_locked.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/try_lock_until/1.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/try_lock_until/2.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/native_handle/1.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/cons: Likewise. * testsuite/30_threads/recursive_timed_mutex/cons/assign_neg.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/cons/1.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/cons/copy_neg.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/requirements/typedefs.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/try_lock/1.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/try_lock/2.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/lock/1.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/lock/2.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/unlock/1.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/try_lock_for/1.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/try_lock_for/2.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/try_lock_for/3.cc: Likewise. * testsuite/30_threads/unique_lock/modifiers/1.cc: Likewise. * testsuite/30_threads/unique_lock/modifiers/2.cc: Likewise. * testsuite/30_threads/unique_lock/cons/1.cc: Likewise. * testsuite/30_threads/unique_lock/cons/2.cc: Likewise. * testsuite/30_threads/unique_lock/cons/3.cc: Likewise. * testsuite/30_threads/unique_lock/cons/4.cc: Likewise. * testsuite/30_threads/unique_lock/cons/5.cc: Likewise. * testsuite/30_threads/unique_lock/cons/6.cc: Likewise. * testsuite/30_threads/unique_lock/locking/1.cc: Likewise. * testsuite/30_threads/unique_lock/locking/2.cc: Likewise. * testsuite/30_threads/unique_lock/locking/3.cc: Likewise. * testsuite/30_threads/unique_lock/locking/4.cc: Likewise. From-SVN: r139943
2008-09-03 19:46:09 +02:00
condition_variable(const condition_variable&) = delete;
condition_variable& operator=(const condition_variable&) = delete;
void
notify_one() noexcept;
condition_variable: New. 2008-05-06 Benjamin Kosnik <bkoz@redhat.com> * include/std/condition_variable: New. * include/std/mutex: New. * src/condition_variable.cc: New. * src/mutex.cc: New. * include/bits/functexcept.h: Add __throw_system_error varients. * src/functexcept.cc: Same. * config/abi/pre/gnu.ver: Add exports. * doc/xml/manual/using.xml: Add new includes. * doc/doxygen/user.cfg.in: Doxygen support. * doc/doxygen/doxygroups.cc: Same. * include/Makefile.am: Add mutex, condition_variable. * include/Makefile.in: Regenerated. * src/Makefile.am: Add mutex.cc, condition_variable.cc. * src/Makefile.in: Regenerated. * testsuite/30_threads: New. * testsuite/30_threads/lock_error: New. * testsuite/30_threads/mutex: New. * testsuite/30_threads/mutex/dest: New. * testsuite/30_threads/mutex/dest/destructor_locked.cc: New. * testsuite/30_threads/mutex/native_handle: New. * testsuite/30_threads/mutex/native_handle/1.cc: New. * testsuite/30_threads/mutex/cons: New. * testsuite/30_threads/mutex/cons/assign_neg.cc: New. * testsuite/30_threads/mutex/cons/1.cc: New. * testsuite/30_threads/mutex/cons/copy_neg.cc: New. * testsuite/30_threads/mutex/requirements: New. * testsuite/30_threads/mutex/requirements/typedefs.cc: New. * testsuite/30_threads/mutex/try_lock: New. * testsuite/30_threads/mutex/try_lock/1.cc: New. * testsuite/30_threads/mutex/try_lock/2.cc: New. * testsuite/30_threads/mutex/lock: New. * testsuite/30_threads/mutex/lock/1.cc: New. * testsuite/30_threads/mutex/unlock: New. * testsuite/30_threads/mutex/unlock/1.cc: New. * testsuite/30_threads/recursive_mutex: New. * testsuite/30_threads/recursive_mutex/dest: New. * testsuite/30_threads/recursive_mutex/dest/destructor_locked.cc: New. * testsuite/30_threads/recursive_mutex/native_handle: New. * testsuite/30_threads/recursive_mutex/native_handle/1.cc: New. * testsuite/30_threads/recursive_mutex/cons: New. * testsuite/30_threads/recursive_mutex/cons/assign_neg.cc: New. * testsuite/30_threads/recursive_mutex/cons/1.cc: New. * testsuite/30_threads/recursive_mutex/cons/copy_neg.cc: New. * testsuite/30_threads/recursive_mutex/requirements: New. * testsuite/30_threads/recursive_mutex/requirements/typedefs.cc: New. * testsuite/30_threads/lock_guard: New. * testsuite/30_threads/lock_guard/requirements: New. * testsuite/30_threads/lock_guard/requirements/typedefs.cc: New. * testsuite/30_threads/lock_guard/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/headers: New. * testsuite/30_threads/headers/mutex: New. * testsuite/30_threads/headers/mutex/types_std_c++0x.cc: New. * testsuite/30_threads/headers/mutex/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/condition_variable: New. * testsuite/30_threads/headers/condition_variable/ types_std_c++0x.cc: New. * testsuite/30_threads/headers/condition_variable/std_c++0x_neg.cc: New. * testsuite/30_threads/once_flag: New. * testsuite/30_threads/unique_lock: New. * testsuite/30_threads/unique_lock/requirements: New. * testsuite/30_threads/unique_lock/requirements/typedefs.cc: New. * testsuite/30_threads/unique_lock/requirements/ explicit_instantiation.cc: New. * testsuite/17_intro/headers/c++200x/all.cc: Add new includes. From-SVN: r135007
2008-05-06 23:11:47 +02:00
void
notify_all() noexcept;
condition_variable: New. 2008-05-06 Benjamin Kosnik <bkoz@redhat.com> * include/std/condition_variable: New. * include/std/mutex: New. * src/condition_variable.cc: New. * src/mutex.cc: New. * include/bits/functexcept.h: Add __throw_system_error varients. * src/functexcept.cc: Same. * config/abi/pre/gnu.ver: Add exports. * doc/xml/manual/using.xml: Add new includes. * doc/doxygen/user.cfg.in: Doxygen support. * doc/doxygen/doxygroups.cc: Same. * include/Makefile.am: Add mutex, condition_variable. * include/Makefile.in: Regenerated. * src/Makefile.am: Add mutex.cc, condition_variable.cc. * src/Makefile.in: Regenerated. * testsuite/30_threads: New. * testsuite/30_threads/lock_error: New. * testsuite/30_threads/mutex: New. * testsuite/30_threads/mutex/dest: New. * testsuite/30_threads/mutex/dest/destructor_locked.cc: New. * testsuite/30_threads/mutex/native_handle: New. * testsuite/30_threads/mutex/native_handle/1.cc: New. * testsuite/30_threads/mutex/cons: New. * testsuite/30_threads/mutex/cons/assign_neg.cc: New. * testsuite/30_threads/mutex/cons/1.cc: New. * testsuite/30_threads/mutex/cons/copy_neg.cc: New. * testsuite/30_threads/mutex/requirements: New. * testsuite/30_threads/mutex/requirements/typedefs.cc: New. * testsuite/30_threads/mutex/try_lock: New. * testsuite/30_threads/mutex/try_lock/1.cc: New. * testsuite/30_threads/mutex/try_lock/2.cc: New. * testsuite/30_threads/mutex/lock: New. * testsuite/30_threads/mutex/lock/1.cc: New. * testsuite/30_threads/mutex/unlock: New. * testsuite/30_threads/mutex/unlock/1.cc: New. * testsuite/30_threads/recursive_mutex: New. * testsuite/30_threads/recursive_mutex/dest: New. * testsuite/30_threads/recursive_mutex/dest/destructor_locked.cc: New. * testsuite/30_threads/recursive_mutex/native_handle: New. * testsuite/30_threads/recursive_mutex/native_handle/1.cc: New. * testsuite/30_threads/recursive_mutex/cons: New. * testsuite/30_threads/recursive_mutex/cons/assign_neg.cc: New. * testsuite/30_threads/recursive_mutex/cons/1.cc: New. * testsuite/30_threads/recursive_mutex/cons/copy_neg.cc: New. * testsuite/30_threads/recursive_mutex/requirements: New. * testsuite/30_threads/recursive_mutex/requirements/typedefs.cc: New. * testsuite/30_threads/lock_guard: New. * testsuite/30_threads/lock_guard/requirements: New. * testsuite/30_threads/lock_guard/requirements/typedefs.cc: New. * testsuite/30_threads/lock_guard/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/headers: New. * testsuite/30_threads/headers/mutex: New. * testsuite/30_threads/headers/mutex/types_std_c++0x.cc: New. * testsuite/30_threads/headers/mutex/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/condition_variable: New. * testsuite/30_threads/headers/condition_variable/ types_std_c++0x.cc: New. * testsuite/30_threads/headers/condition_variable/std_c++0x_neg.cc: New. * testsuite/30_threads/once_flag: New. * testsuite/30_threads/unique_lock: New. * testsuite/30_threads/unique_lock/requirements: New. * testsuite/30_threads/unique_lock/requirements/typedefs.cc: New. * testsuite/30_threads/unique_lock/requirements/ explicit_instantiation.cc: New. * testsuite/17_intro/headers/c++200x/all.cc: Add new includes. From-SVN: r135007
2008-05-06 23:11:47 +02:00
void
condition_variable: New. 2008-05-06 Benjamin Kosnik <bkoz@redhat.com> * include/std/condition_variable: New. * include/std/mutex: New. * src/condition_variable.cc: New. * src/mutex.cc: New. * include/bits/functexcept.h: Add __throw_system_error varients. * src/functexcept.cc: Same. * config/abi/pre/gnu.ver: Add exports. * doc/xml/manual/using.xml: Add new includes. * doc/doxygen/user.cfg.in: Doxygen support. * doc/doxygen/doxygroups.cc: Same. * include/Makefile.am: Add mutex, condition_variable. * include/Makefile.in: Regenerated. * src/Makefile.am: Add mutex.cc, condition_variable.cc. * src/Makefile.in: Regenerated. * testsuite/30_threads: New. * testsuite/30_threads/lock_error: New. * testsuite/30_threads/mutex: New. * testsuite/30_threads/mutex/dest: New. * testsuite/30_threads/mutex/dest/destructor_locked.cc: New. * testsuite/30_threads/mutex/native_handle: New. * testsuite/30_threads/mutex/native_handle/1.cc: New. * testsuite/30_threads/mutex/cons: New. * testsuite/30_threads/mutex/cons/assign_neg.cc: New. * testsuite/30_threads/mutex/cons/1.cc: New. * testsuite/30_threads/mutex/cons/copy_neg.cc: New. * testsuite/30_threads/mutex/requirements: New. * testsuite/30_threads/mutex/requirements/typedefs.cc: New. * testsuite/30_threads/mutex/try_lock: New. * testsuite/30_threads/mutex/try_lock/1.cc: New. * testsuite/30_threads/mutex/try_lock/2.cc: New. * testsuite/30_threads/mutex/lock: New. * testsuite/30_threads/mutex/lock/1.cc: New. * testsuite/30_threads/mutex/unlock: New. * testsuite/30_threads/mutex/unlock/1.cc: New. * testsuite/30_threads/recursive_mutex: New. * testsuite/30_threads/recursive_mutex/dest: New. * testsuite/30_threads/recursive_mutex/dest/destructor_locked.cc: New. * testsuite/30_threads/recursive_mutex/native_handle: New. * testsuite/30_threads/recursive_mutex/native_handle/1.cc: New. * testsuite/30_threads/recursive_mutex/cons: New. * testsuite/30_threads/recursive_mutex/cons/assign_neg.cc: New. * testsuite/30_threads/recursive_mutex/cons/1.cc: New. * testsuite/30_threads/recursive_mutex/cons/copy_neg.cc: New. * testsuite/30_threads/recursive_mutex/requirements: New. * testsuite/30_threads/recursive_mutex/requirements/typedefs.cc: New. * testsuite/30_threads/lock_guard: New. * testsuite/30_threads/lock_guard/requirements: New. * testsuite/30_threads/lock_guard/requirements/typedefs.cc: New. * testsuite/30_threads/lock_guard/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/headers: New. * testsuite/30_threads/headers/mutex: New. * testsuite/30_threads/headers/mutex/types_std_c++0x.cc: New. * testsuite/30_threads/headers/mutex/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/condition_variable: New. * testsuite/30_threads/headers/condition_variable/ types_std_c++0x.cc: New. * testsuite/30_threads/headers/condition_variable/std_c++0x_neg.cc: New. * testsuite/30_threads/once_flag: New. * testsuite/30_threads/unique_lock: New. * testsuite/30_threads/unique_lock/requirements: New. * testsuite/30_threads/unique_lock/requirements/typedefs.cc: New. * testsuite/30_threads/unique_lock/requirements/ explicit_instantiation.cc: New. * testsuite/17_intro/headers/c++200x/all.cc: Add new includes. From-SVN: r135007
2008-05-06 23:11:47 +02:00
wait(unique_lock<mutex>& __lock);
template<typename _Predicate>
void
condition_variable: New. 2008-05-06 Benjamin Kosnik <bkoz@redhat.com> * include/std/condition_variable: New. * include/std/mutex: New. * src/condition_variable.cc: New. * src/mutex.cc: New. * include/bits/functexcept.h: Add __throw_system_error varients. * src/functexcept.cc: Same. * config/abi/pre/gnu.ver: Add exports. * doc/xml/manual/using.xml: Add new includes. * doc/doxygen/user.cfg.in: Doxygen support. * doc/doxygen/doxygroups.cc: Same. * include/Makefile.am: Add mutex, condition_variable. * include/Makefile.in: Regenerated. * src/Makefile.am: Add mutex.cc, condition_variable.cc. * src/Makefile.in: Regenerated. * testsuite/30_threads: New. * testsuite/30_threads/lock_error: New. * testsuite/30_threads/mutex: New. * testsuite/30_threads/mutex/dest: New. * testsuite/30_threads/mutex/dest/destructor_locked.cc: New. * testsuite/30_threads/mutex/native_handle: New. * testsuite/30_threads/mutex/native_handle/1.cc: New. * testsuite/30_threads/mutex/cons: New. * testsuite/30_threads/mutex/cons/assign_neg.cc: New. * testsuite/30_threads/mutex/cons/1.cc: New. * testsuite/30_threads/mutex/cons/copy_neg.cc: New. * testsuite/30_threads/mutex/requirements: New. * testsuite/30_threads/mutex/requirements/typedefs.cc: New. * testsuite/30_threads/mutex/try_lock: New. * testsuite/30_threads/mutex/try_lock/1.cc: New. * testsuite/30_threads/mutex/try_lock/2.cc: New. * testsuite/30_threads/mutex/lock: New. * testsuite/30_threads/mutex/lock/1.cc: New. * testsuite/30_threads/mutex/unlock: New. * testsuite/30_threads/mutex/unlock/1.cc: New. * testsuite/30_threads/recursive_mutex: New. * testsuite/30_threads/recursive_mutex/dest: New. * testsuite/30_threads/recursive_mutex/dest/destructor_locked.cc: New. * testsuite/30_threads/recursive_mutex/native_handle: New. * testsuite/30_threads/recursive_mutex/native_handle/1.cc: New. * testsuite/30_threads/recursive_mutex/cons: New. * testsuite/30_threads/recursive_mutex/cons/assign_neg.cc: New. * testsuite/30_threads/recursive_mutex/cons/1.cc: New. * testsuite/30_threads/recursive_mutex/cons/copy_neg.cc: New. * testsuite/30_threads/recursive_mutex/requirements: New. * testsuite/30_threads/recursive_mutex/requirements/typedefs.cc: New. * testsuite/30_threads/lock_guard: New. * testsuite/30_threads/lock_guard/requirements: New. * testsuite/30_threads/lock_guard/requirements/typedefs.cc: New. * testsuite/30_threads/lock_guard/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/headers: New. * testsuite/30_threads/headers/mutex: New. * testsuite/30_threads/headers/mutex/types_std_c++0x.cc: New. * testsuite/30_threads/headers/mutex/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/condition_variable: New. * testsuite/30_threads/headers/condition_variable/ types_std_c++0x.cc: New. * testsuite/30_threads/headers/condition_variable/std_c++0x_neg.cc: New. * testsuite/30_threads/once_flag: New. * testsuite/30_threads/unique_lock: New. * testsuite/30_threads/unique_lock/requirements: New. * testsuite/30_threads/unique_lock/requirements/typedefs.cc: New. * testsuite/30_threads/unique_lock/requirements/ explicit_instantiation.cc: New. * testsuite/17_intro/headers/c++200x/all.cc: Add new includes. From-SVN: r135007
2008-05-06 23:11:47 +02:00
wait(unique_lock<mutex>& __lock, _Predicate __p)
{
while (!__p())
wait(__lock);
}
template<typename _Duration>
cv_status
wait_until(unique_lock<mutex>& __lock,
const chrono::time_point<__clock_t, _Duration>& __atime)
{ return __wait_until_impl(__lock, __atime); }
template<typename _Clock, typename _Duration>
cv_status
wait_until(unique_lock<mutex>& __lock,
condition_variable: Use new deleted ctors. 2008-09-03 Chris Fairles <chris.fairles@gmail.com> * include/std/condition_variable: Use new deleted ctors. * include/std/mutex: Likewise plus implement timed_mutex, recursive_timed_mutex and call_once. * src/condition_variable.cc: Implement wait(). Use gthread types. Remove _GTHREADS_HAS_COND checks in favor of global _GLIBCXX_HAS_GTHREADS. * src/mutex.cc (call_once): Implementation using TLS with mutex fallback. * config/abi/pre/gnu.ver: Add exported symbols. * testsuite/lib/libstdc++.exp (check_v3_target_gthreads): New. * testsuite/lib/dg-options.exp (dg-require-gthreads): Likewise. * testsuite/30_threads/lock_guard/requirements/typedefs.cc: Use dg-require-gthreads and dg-require-cstdint. * testsuite/30_threads/lock_guard/requirements/ explicit_instantiation.cc: Likewise. * testsuite/30_threads/mutex/dest/destructor_locked.cc: Likewise. * testsuite/30_threads/mutex/native_handle/1.cc: Likewise. * testsuite/30_threads/mutex/cons/1.cc: Likewise. * testsuite/30_threads/mutex/requirements/typedefs.cc: Likewise. * testsuite/30_threads/mutex/try_lock/1.cc: Likewise. * testsuite/30_threads/mutex/try_lock/2.cc: Likewise. * testsuite/30_threads/mutex/lock/1.cc: Likewise. * testsuite/30_threads/mutex/unlock/1.cc: Likewise. * testsuite/30_threads/recursive_mutex/dest/destructor_locked.cc: Likewise. * testsuite/30_threads/recursive_mutex/native_handle/1.cc: Likewise. * testsuite/30_threads/recursive_mutex/cons/1.cc: Likewise. * testsuite/30_threads/recursive_mutex/requirements/typedefs.cc: Likewise. * testsuite/30_threads/recursive_mutex/try_lock/1.cc: Likewise. * testsuite/30_threads/recursive_mutex/try_lock/2.cc: Likewise. * testsuite/30_threads/recursive_mutex/lock/1.cc: Likewise. * testsuite/30_threads/recursive_mutex/unlock/1.cc: Likewise. * testsuite/30_threads/unique_lock/requirements/ explicit_instantiation.cc: Likewise. * testsuite/30_threads/unique_lock/requirements/typedefs.cc: Likewise. * testsuite/30_threads/mutex/cons/assign_neg.cc: Also adjust dg-error lines for deleted members. * testsuite/30_threads/mutex/cons/copy_neg.cc: Likewise. * testsuite/30_threads/recursive_mutex/cons/assign_neg.cc: Likewise. * testsuite/30_threads/recursive_mutex/cons/copy_neg.cc: Likewise. * testsuite/30_threads/call_once/once_flag.cc: New. * testsuite/30_threads/call_once/call_once1.cc: Likewise. * testsuite/30_threads/condition_variable/cons/1.cc: Likewise. * testsuite/30_threads/condition_variable/cons/copy_neg.cc: Likewise * testsuite/30_threads/condition_variable/cons/assign_neg.cc: Likewise. * testsuite/30_threads/condition_variable_any/cons/1.cc: Likewise. * testsuite/30_threads/condition_variable_any/cons/copy_neg.cc: Likewise. * testsuite/30_threads/condition_variable_any/cons/assign_neg.cc: Likewise. * testsuite/30_threads/timed_mutex/dest/destructor_locked.cc: Likewise. * testsuite/30_threads/timed_mutex/native_handle/1.cc: Likewise. * testsuite/30_threads/timed_mutex/try_lock_until/1.cc: Likewise. * testsuite/30_threads/timed_mutex/try_lock_until/2.cc: Likewise. * testsuite/30_threads/timed_mutex/cons/assign_neg.cc: Likewise. * testsuite/30_threads/timed_mutex/cons/1.cc: Likewise. * testsuite/30_threads/timed_mutex/cons/copy_neg.cc: Likewise. * testsuite/30_threads/timed_mutex/requirements/typedefs.cc: Likewise. * testsuite/30_threads/timed_mutex/try_lock/1.cc: Likewise. * testsuite/30_threads/timed_mutex/try_lock/2.cc: Likewise. * testsuite/30_threads/timed_mutex/lock/1.cc: Likewise. * testsuite/30_threads/timed_mutex/unlock/1.cc: Likewise. * testsuite/30_threads/timed_mutex/try_lock_for/1.cc: Likewise. * testsuite/30_threads/timed_mutex/try_lock_for/2.cc: Likewise. * testsuite/30_threads/timed_mutex/try_lock_for/3.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/dest/destructor_locked.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/try_lock_until/1.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/try_lock_until/2.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/native_handle/1.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/cons: Likewise. * testsuite/30_threads/recursive_timed_mutex/cons/assign_neg.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/cons/1.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/cons/copy_neg.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/requirements/typedefs.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/try_lock/1.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/try_lock/2.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/lock/1.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/lock/2.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/unlock/1.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/try_lock_for/1.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/try_lock_for/2.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/try_lock_for/3.cc: Likewise. * testsuite/30_threads/unique_lock/modifiers/1.cc: Likewise. * testsuite/30_threads/unique_lock/modifiers/2.cc: Likewise. * testsuite/30_threads/unique_lock/cons/1.cc: Likewise. * testsuite/30_threads/unique_lock/cons/2.cc: Likewise. * testsuite/30_threads/unique_lock/cons/3.cc: Likewise. * testsuite/30_threads/unique_lock/cons/4.cc: Likewise. * testsuite/30_threads/unique_lock/cons/5.cc: Likewise. * testsuite/30_threads/unique_lock/cons/6.cc: Likewise. * testsuite/30_threads/unique_lock/locking/1.cc: Likewise. * testsuite/30_threads/unique_lock/locking/2.cc: Likewise. * testsuite/30_threads/unique_lock/locking/3.cc: Likewise. * testsuite/30_threads/unique_lock/locking/4.cc: Likewise. From-SVN: r139943
2008-09-03 19:46:09 +02:00
const chrono::time_point<_Clock, _Duration>& __atime)
{
// DR 887 - Sync unknown clock to known clock.
const typename _Clock::time_point __c_entry = _Clock::now();
const __clock_t::time_point __s_entry = __clock_t::now();
const auto __delta = __atime - __c_entry;
const auto __s_atime = __s_entry + __delta;
condition_variable: Use new deleted ctors. 2008-09-03 Chris Fairles <chris.fairles@gmail.com> * include/std/condition_variable: Use new deleted ctors. * include/std/mutex: Likewise plus implement timed_mutex, recursive_timed_mutex and call_once. * src/condition_variable.cc: Implement wait(). Use gthread types. Remove _GTHREADS_HAS_COND checks in favor of global _GLIBCXX_HAS_GTHREADS. * src/mutex.cc (call_once): Implementation using TLS with mutex fallback. * config/abi/pre/gnu.ver: Add exported symbols. * testsuite/lib/libstdc++.exp (check_v3_target_gthreads): New. * testsuite/lib/dg-options.exp (dg-require-gthreads): Likewise. * testsuite/30_threads/lock_guard/requirements/typedefs.cc: Use dg-require-gthreads and dg-require-cstdint. * testsuite/30_threads/lock_guard/requirements/ explicit_instantiation.cc: Likewise. * testsuite/30_threads/mutex/dest/destructor_locked.cc: Likewise. * testsuite/30_threads/mutex/native_handle/1.cc: Likewise. * testsuite/30_threads/mutex/cons/1.cc: Likewise. * testsuite/30_threads/mutex/requirements/typedefs.cc: Likewise. * testsuite/30_threads/mutex/try_lock/1.cc: Likewise. * testsuite/30_threads/mutex/try_lock/2.cc: Likewise. * testsuite/30_threads/mutex/lock/1.cc: Likewise. * testsuite/30_threads/mutex/unlock/1.cc: Likewise. * testsuite/30_threads/recursive_mutex/dest/destructor_locked.cc: Likewise. * testsuite/30_threads/recursive_mutex/native_handle/1.cc: Likewise. * testsuite/30_threads/recursive_mutex/cons/1.cc: Likewise. * testsuite/30_threads/recursive_mutex/requirements/typedefs.cc: Likewise. * testsuite/30_threads/recursive_mutex/try_lock/1.cc: Likewise. * testsuite/30_threads/recursive_mutex/try_lock/2.cc: Likewise. * testsuite/30_threads/recursive_mutex/lock/1.cc: Likewise. * testsuite/30_threads/recursive_mutex/unlock/1.cc: Likewise. * testsuite/30_threads/unique_lock/requirements/ explicit_instantiation.cc: Likewise. * testsuite/30_threads/unique_lock/requirements/typedefs.cc: Likewise. * testsuite/30_threads/mutex/cons/assign_neg.cc: Also adjust dg-error lines for deleted members. * testsuite/30_threads/mutex/cons/copy_neg.cc: Likewise. * testsuite/30_threads/recursive_mutex/cons/assign_neg.cc: Likewise. * testsuite/30_threads/recursive_mutex/cons/copy_neg.cc: Likewise. * testsuite/30_threads/call_once/once_flag.cc: New. * testsuite/30_threads/call_once/call_once1.cc: Likewise. * testsuite/30_threads/condition_variable/cons/1.cc: Likewise. * testsuite/30_threads/condition_variable/cons/copy_neg.cc: Likewise * testsuite/30_threads/condition_variable/cons/assign_neg.cc: Likewise. * testsuite/30_threads/condition_variable_any/cons/1.cc: Likewise. * testsuite/30_threads/condition_variable_any/cons/copy_neg.cc: Likewise. * testsuite/30_threads/condition_variable_any/cons/assign_neg.cc: Likewise. * testsuite/30_threads/timed_mutex/dest/destructor_locked.cc: Likewise. * testsuite/30_threads/timed_mutex/native_handle/1.cc: Likewise. * testsuite/30_threads/timed_mutex/try_lock_until/1.cc: Likewise. * testsuite/30_threads/timed_mutex/try_lock_until/2.cc: Likewise. * testsuite/30_threads/timed_mutex/cons/assign_neg.cc: Likewise. * testsuite/30_threads/timed_mutex/cons/1.cc: Likewise. * testsuite/30_threads/timed_mutex/cons/copy_neg.cc: Likewise. * testsuite/30_threads/timed_mutex/requirements/typedefs.cc: Likewise. * testsuite/30_threads/timed_mutex/try_lock/1.cc: Likewise. * testsuite/30_threads/timed_mutex/try_lock/2.cc: Likewise. * testsuite/30_threads/timed_mutex/lock/1.cc: Likewise. * testsuite/30_threads/timed_mutex/unlock/1.cc: Likewise. * testsuite/30_threads/timed_mutex/try_lock_for/1.cc: Likewise. * testsuite/30_threads/timed_mutex/try_lock_for/2.cc: Likewise. * testsuite/30_threads/timed_mutex/try_lock_for/3.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/dest/destructor_locked.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/try_lock_until/1.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/try_lock_until/2.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/native_handle/1.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/cons: Likewise. * testsuite/30_threads/recursive_timed_mutex/cons/assign_neg.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/cons/1.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/cons/copy_neg.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/requirements/typedefs.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/try_lock/1.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/try_lock/2.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/lock/1.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/lock/2.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/unlock/1.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/try_lock_for/1.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/try_lock_for/2.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/try_lock_for/3.cc: Likewise. * testsuite/30_threads/unique_lock/modifiers/1.cc: Likewise. * testsuite/30_threads/unique_lock/modifiers/2.cc: Likewise. * testsuite/30_threads/unique_lock/cons/1.cc: Likewise. * testsuite/30_threads/unique_lock/cons/2.cc: Likewise. * testsuite/30_threads/unique_lock/cons/3.cc: Likewise. * testsuite/30_threads/unique_lock/cons/4.cc: Likewise. * testsuite/30_threads/unique_lock/cons/5.cc: Likewise. * testsuite/30_threads/unique_lock/cons/6.cc: Likewise. * testsuite/30_threads/unique_lock/locking/1.cc: Likewise. * testsuite/30_threads/unique_lock/locking/2.cc: Likewise. * testsuite/30_threads/unique_lock/locking/3.cc: Likewise. * testsuite/30_threads/unique_lock/locking/4.cc: Likewise. From-SVN: r139943
2008-09-03 19:46:09 +02:00
return __wait_until_impl(__lock, __s_atime);
condition_variable: Use new deleted ctors. 2008-09-03 Chris Fairles <chris.fairles@gmail.com> * include/std/condition_variable: Use new deleted ctors. * include/std/mutex: Likewise plus implement timed_mutex, recursive_timed_mutex and call_once. * src/condition_variable.cc: Implement wait(). Use gthread types. Remove _GTHREADS_HAS_COND checks in favor of global _GLIBCXX_HAS_GTHREADS. * src/mutex.cc (call_once): Implementation using TLS with mutex fallback. * config/abi/pre/gnu.ver: Add exported symbols. * testsuite/lib/libstdc++.exp (check_v3_target_gthreads): New. * testsuite/lib/dg-options.exp (dg-require-gthreads): Likewise. * testsuite/30_threads/lock_guard/requirements/typedefs.cc: Use dg-require-gthreads and dg-require-cstdint. * testsuite/30_threads/lock_guard/requirements/ explicit_instantiation.cc: Likewise. * testsuite/30_threads/mutex/dest/destructor_locked.cc: Likewise. * testsuite/30_threads/mutex/native_handle/1.cc: Likewise. * testsuite/30_threads/mutex/cons/1.cc: Likewise. * testsuite/30_threads/mutex/requirements/typedefs.cc: Likewise. * testsuite/30_threads/mutex/try_lock/1.cc: Likewise. * testsuite/30_threads/mutex/try_lock/2.cc: Likewise. * testsuite/30_threads/mutex/lock/1.cc: Likewise. * testsuite/30_threads/mutex/unlock/1.cc: Likewise. * testsuite/30_threads/recursive_mutex/dest/destructor_locked.cc: Likewise. * testsuite/30_threads/recursive_mutex/native_handle/1.cc: Likewise. * testsuite/30_threads/recursive_mutex/cons/1.cc: Likewise. * testsuite/30_threads/recursive_mutex/requirements/typedefs.cc: Likewise. * testsuite/30_threads/recursive_mutex/try_lock/1.cc: Likewise. * testsuite/30_threads/recursive_mutex/try_lock/2.cc: Likewise. * testsuite/30_threads/recursive_mutex/lock/1.cc: Likewise. * testsuite/30_threads/recursive_mutex/unlock/1.cc: Likewise. * testsuite/30_threads/unique_lock/requirements/ explicit_instantiation.cc: Likewise. * testsuite/30_threads/unique_lock/requirements/typedefs.cc: Likewise. * testsuite/30_threads/mutex/cons/assign_neg.cc: Also adjust dg-error lines for deleted members. * testsuite/30_threads/mutex/cons/copy_neg.cc: Likewise. * testsuite/30_threads/recursive_mutex/cons/assign_neg.cc: Likewise. * testsuite/30_threads/recursive_mutex/cons/copy_neg.cc: Likewise. * testsuite/30_threads/call_once/once_flag.cc: New. * testsuite/30_threads/call_once/call_once1.cc: Likewise. * testsuite/30_threads/condition_variable/cons/1.cc: Likewise. * testsuite/30_threads/condition_variable/cons/copy_neg.cc: Likewise * testsuite/30_threads/condition_variable/cons/assign_neg.cc: Likewise. * testsuite/30_threads/condition_variable_any/cons/1.cc: Likewise. * testsuite/30_threads/condition_variable_any/cons/copy_neg.cc: Likewise. * testsuite/30_threads/condition_variable_any/cons/assign_neg.cc: Likewise. * testsuite/30_threads/timed_mutex/dest/destructor_locked.cc: Likewise. * testsuite/30_threads/timed_mutex/native_handle/1.cc: Likewise. * testsuite/30_threads/timed_mutex/try_lock_until/1.cc: Likewise. * testsuite/30_threads/timed_mutex/try_lock_until/2.cc: Likewise. * testsuite/30_threads/timed_mutex/cons/assign_neg.cc: Likewise. * testsuite/30_threads/timed_mutex/cons/1.cc: Likewise. * testsuite/30_threads/timed_mutex/cons/copy_neg.cc: Likewise. * testsuite/30_threads/timed_mutex/requirements/typedefs.cc: Likewise. * testsuite/30_threads/timed_mutex/try_lock/1.cc: Likewise. * testsuite/30_threads/timed_mutex/try_lock/2.cc: Likewise. * testsuite/30_threads/timed_mutex/lock/1.cc: Likewise. * testsuite/30_threads/timed_mutex/unlock/1.cc: Likewise. * testsuite/30_threads/timed_mutex/try_lock_for/1.cc: Likewise. * testsuite/30_threads/timed_mutex/try_lock_for/2.cc: Likewise. * testsuite/30_threads/timed_mutex/try_lock_for/3.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/dest/destructor_locked.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/try_lock_until/1.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/try_lock_until/2.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/native_handle/1.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/cons: Likewise. * testsuite/30_threads/recursive_timed_mutex/cons/assign_neg.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/cons/1.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/cons/copy_neg.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/requirements/typedefs.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/try_lock/1.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/try_lock/2.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/lock/1.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/lock/2.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/unlock/1.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/try_lock_for/1.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/try_lock_for/2.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/try_lock_for/3.cc: Likewise. * testsuite/30_threads/unique_lock/modifiers/1.cc: Likewise. * testsuite/30_threads/unique_lock/modifiers/2.cc: Likewise. * testsuite/30_threads/unique_lock/cons/1.cc: Likewise. * testsuite/30_threads/unique_lock/cons/2.cc: Likewise. * testsuite/30_threads/unique_lock/cons/3.cc: Likewise. * testsuite/30_threads/unique_lock/cons/4.cc: Likewise. * testsuite/30_threads/unique_lock/cons/5.cc: Likewise. * testsuite/30_threads/unique_lock/cons/6.cc: Likewise. * testsuite/30_threads/unique_lock/locking/1.cc: Likewise. * testsuite/30_threads/unique_lock/locking/2.cc: Likewise. * testsuite/30_threads/unique_lock/locking/3.cc: Likewise. * testsuite/30_threads/unique_lock/locking/4.cc: Likewise. From-SVN: r139943
2008-09-03 19:46:09 +02:00
}
template<typename _Clock, typename _Duration, typename _Predicate>
bool
wait_until(unique_lock<mutex>& __lock,
const chrono::time_point<_Clock, _Duration>& __atime,
_Predicate __p)
{
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
2009-02-10 09:29:57 +01:00
while (!__p())
if (wait_until(__lock, __atime) == cv_status::timeout)
return __p();
return true;
}
template<typename _Rep, typename _Period>
cv_status
wait_for(unique_lock<mutex>& __lock,
condition_variable: Use new deleted ctors. 2008-09-03 Chris Fairles <chris.fairles@gmail.com> * include/std/condition_variable: Use new deleted ctors. * include/std/mutex: Likewise plus implement timed_mutex, recursive_timed_mutex and call_once. * src/condition_variable.cc: Implement wait(). Use gthread types. Remove _GTHREADS_HAS_COND checks in favor of global _GLIBCXX_HAS_GTHREADS. * src/mutex.cc (call_once): Implementation using TLS with mutex fallback. * config/abi/pre/gnu.ver: Add exported symbols. * testsuite/lib/libstdc++.exp (check_v3_target_gthreads): New. * testsuite/lib/dg-options.exp (dg-require-gthreads): Likewise. * testsuite/30_threads/lock_guard/requirements/typedefs.cc: Use dg-require-gthreads and dg-require-cstdint. * testsuite/30_threads/lock_guard/requirements/ explicit_instantiation.cc: Likewise. * testsuite/30_threads/mutex/dest/destructor_locked.cc: Likewise. * testsuite/30_threads/mutex/native_handle/1.cc: Likewise. * testsuite/30_threads/mutex/cons/1.cc: Likewise. * testsuite/30_threads/mutex/requirements/typedefs.cc: Likewise. * testsuite/30_threads/mutex/try_lock/1.cc: Likewise. * testsuite/30_threads/mutex/try_lock/2.cc: Likewise. * testsuite/30_threads/mutex/lock/1.cc: Likewise. * testsuite/30_threads/mutex/unlock/1.cc: Likewise. * testsuite/30_threads/recursive_mutex/dest/destructor_locked.cc: Likewise. * testsuite/30_threads/recursive_mutex/native_handle/1.cc: Likewise. * testsuite/30_threads/recursive_mutex/cons/1.cc: Likewise. * testsuite/30_threads/recursive_mutex/requirements/typedefs.cc: Likewise. * testsuite/30_threads/recursive_mutex/try_lock/1.cc: Likewise. * testsuite/30_threads/recursive_mutex/try_lock/2.cc: Likewise. * testsuite/30_threads/recursive_mutex/lock/1.cc: Likewise. * testsuite/30_threads/recursive_mutex/unlock/1.cc: Likewise. * testsuite/30_threads/unique_lock/requirements/ explicit_instantiation.cc: Likewise. * testsuite/30_threads/unique_lock/requirements/typedefs.cc: Likewise. * testsuite/30_threads/mutex/cons/assign_neg.cc: Also adjust dg-error lines for deleted members. * testsuite/30_threads/mutex/cons/copy_neg.cc: Likewise. * testsuite/30_threads/recursive_mutex/cons/assign_neg.cc: Likewise. * testsuite/30_threads/recursive_mutex/cons/copy_neg.cc: Likewise. * testsuite/30_threads/call_once/once_flag.cc: New. * testsuite/30_threads/call_once/call_once1.cc: Likewise. * testsuite/30_threads/condition_variable/cons/1.cc: Likewise. * testsuite/30_threads/condition_variable/cons/copy_neg.cc: Likewise * testsuite/30_threads/condition_variable/cons/assign_neg.cc: Likewise. * testsuite/30_threads/condition_variable_any/cons/1.cc: Likewise. * testsuite/30_threads/condition_variable_any/cons/copy_neg.cc: Likewise. * testsuite/30_threads/condition_variable_any/cons/assign_neg.cc: Likewise. * testsuite/30_threads/timed_mutex/dest/destructor_locked.cc: Likewise. * testsuite/30_threads/timed_mutex/native_handle/1.cc: Likewise. * testsuite/30_threads/timed_mutex/try_lock_until/1.cc: Likewise. * testsuite/30_threads/timed_mutex/try_lock_until/2.cc: Likewise. * testsuite/30_threads/timed_mutex/cons/assign_neg.cc: Likewise. * testsuite/30_threads/timed_mutex/cons/1.cc: Likewise. * testsuite/30_threads/timed_mutex/cons/copy_neg.cc: Likewise. * testsuite/30_threads/timed_mutex/requirements/typedefs.cc: Likewise. * testsuite/30_threads/timed_mutex/try_lock/1.cc: Likewise. * testsuite/30_threads/timed_mutex/try_lock/2.cc: Likewise. * testsuite/30_threads/timed_mutex/lock/1.cc: Likewise. * testsuite/30_threads/timed_mutex/unlock/1.cc: Likewise. * testsuite/30_threads/timed_mutex/try_lock_for/1.cc: Likewise. * testsuite/30_threads/timed_mutex/try_lock_for/2.cc: Likewise. * testsuite/30_threads/timed_mutex/try_lock_for/3.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/dest/destructor_locked.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/try_lock_until/1.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/try_lock_until/2.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/native_handle/1.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/cons: Likewise. * testsuite/30_threads/recursive_timed_mutex/cons/assign_neg.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/cons/1.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/cons/copy_neg.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/requirements/typedefs.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/try_lock/1.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/try_lock/2.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/lock/1.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/lock/2.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/unlock/1.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/try_lock_for/1.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/try_lock_for/2.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/try_lock_for/3.cc: Likewise. * testsuite/30_threads/unique_lock/modifiers/1.cc: Likewise. * testsuite/30_threads/unique_lock/modifiers/2.cc: Likewise. * testsuite/30_threads/unique_lock/cons/1.cc: Likewise. * testsuite/30_threads/unique_lock/cons/2.cc: Likewise. * testsuite/30_threads/unique_lock/cons/3.cc: Likewise. * testsuite/30_threads/unique_lock/cons/4.cc: Likewise. * testsuite/30_threads/unique_lock/cons/5.cc: Likewise. * testsuite/30_threads/unique_lock/cons/6.cc: Likewise. * testsuite/30_threads/unique_lock/locking/1.cc: Likewise. * testsuite/30_threads/unique_lock/locking/2.cc: Likewise. * testsuite/30_threads/unique_lock/locking/3.cc: Likewise. * testsuite/30_threads/unique_lock/locking/4.cc: Likewise. From-SVN: r139943
2008-09-03 19:46:09 +02:00
const chrono::duration<_Rep, _Period>& __rtime)
{ return wait_until(__lock, __clock_t::now() + __rtime); }
template<typename _Rep, typename _Period, typename _Predicate>
bool
wait_for(unique_lock<mutex>& __lock,
const chrono::duration<_Rep, _Period>& __rtime,
_Predicate __p)
{ return wait_until(__lock, __clock_t::now() + __rtime, std::move(__p)); }
condition_variable: New. 2008-05-06 Benjamin Kosnik <bkoz@redhat.com> * include/std/condition_variable: New. * include/std/mutex: New. * src/condition_variable.cc: New. * src/mutex.cc: New. * include/bits/functexcept.h: Add __throw_system_error varients. * src/functexcept.cc: Same. * config/abi/pre/gnu.ver: Add exports. * doc/xml/manual/using.xml: Add new includes. * doc/doxygen/user.cfg.in: Doxygen support. * doc/doxygen/doxygroups.cc: Same. * include/Makefile.am: Add mutex, condition_variable. * include/Makefile.in: Regenerated. * src/Makefile.am: Add mutex.cc, condition_variable.cc. * src/Makefile.in: Regenerated. * testsuite/30_threads: New. * testsuite/30_threads/lock_error: New. * testsuite/30_threads/mutex: New. * testsuite/30_threads/mutex/dest: New. * testsuite/30_threads/mutex/dest/destructor_locked.cc: New. * testsuite/30_threads/mutex/native_handle: New. * testsuite/30_threads/mutex/native_handle/1.cc: New. * testsuite/30_threads/mutex/cons: New. * testsuite/30_threads/mutex/cons/assign_neg.cc: New. * testsuite/30_threads/mutex/cons/1.cc: New. * testsuite/30_threads/mutex/cons/copy_neg.cc: New. * testsuite/30_threads/mutex/requirements: New. * testsuite/30_threads/mutex/requirements/typedefs.cc: New. * testsuite/30_threads/mutex/try_lock: New. * testsuite/30_threads/mutex/try_lock/1.cc: New. * testsuite/30_threads/mutex/try_lock/2.cc: New. * testsuite/30_threads/mutex/lock: New. * testsuite/30_threads/mutex/lock/1.cc: New. * testsuite/30_threads/mutex/unlock: New. * testsuite/30_threads/mutex/unlock/1.cc: New. * testsuite/30_threads/recursive_mutex: New. * testsuite/30_threads/recursive_mutex/dest: New. * testsuite/30_threads/recursive_mutex/dest/destructor_locked.cc: New. * testsuite/30_threads/recursive_mutex/native_handle: New. * testsuite/30_threads/recursive_mutex/native_handle/1.cc: New. * testsuite/30_threads/recursive_mutex/cons: New. * testsuite/30_threads/recursive_mutex/cons/assign_neg.cc: New. * testsuite/30_threads/recursive_mutex/cons/1.cc: New. * testsuite/30_threads/recursive_mutex/cons/copy_neg.cc: New. * testsuite/30_threads/recursive_mutex/requirements: New. * testsuite/30_threads/recursive_mutex/requirements/typedefs.cc: New. * testsuite/30_threads/lock_guard: New. * testsuite/30_threads/lock_guard/requirements: New. * testsuite/30_threads/lock_guard/requirements/typedefs.cc: New. * testsuite/30_threads/lock_guard/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/headers: New. * testsuite/30_threads/headers/mutex: New. * testsuite/30_threads/headers/mutex/types_std_c++0x.cc: New. * testsuite/30_threads/headers/mutex/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/condition_variable: New. * testsuite/30_threads/headers/condition_variable/ types_std_c++0x.cc: New. * testsuite/30_threads/headers/condition_variable/std_c++0x_neg.cc: New. * testsuite/30_threads/once_flag: New. * testsuite/30_threads/unique_lock: New. * testsuite/30_threads/unique_lock/requirements: New. * testsuite/30_threads/unique_lock/requirements/typedefs.cc: New. * testsuite/30_threads/unique_lock/requirements/ explicit_instantiation.cc: New. * testsuite/17_intro/headers/c++200x/all.cc: Add new includes. From-SVN: r135007
2008-05-06 23:11:47 +02:00
native_handle_type
native_handle()
condition_variable: Use new deleted ctors. 2008-09-03 Chris Fairles <chris.fairles@gmail.com> * include/std/condition_variable: Use new deleted ctors. * include/std/mutex: Likewise plus implement timed_mutex, recursive_timed_mutex and call_once. * src/condition_variable.cc: Implement wait(). Use gthread types. Remove _GTHREADS_HAS_COND checks in favor of global _GLIBCXX_HAS_GTHREADS. * src/mutex.cc (call_once): Implementation using TLS with mutex fallback. * config/abi/pre/gnu.ver: Add exported symbols. * testsuite/lib/libstdc++.exp (check_v3_target_gthreads): New. * testsuite/lib/dg-options.exp (dg-require-gthreads): Likewise. * testsuite/30_threads/lock_guard/requirements/typedefs.cc: Use dg-require-gthreads and dg-require-cstdint. * testsuite/30_threads/lock_guard/requirements/ explicit_instantiation.cc: Likewise. * testsuite/30_threads/mutex/dest/destructor_locked.cc: Likewise. * testsuite/30_threads/mutex/native_handle/1.cc: Likewise. * testsuite/30_threads/mutex/cons/1.cc: Likewise. * testsuite/30_threads/mutex/requirements/typedefs.cc: Likewise. * testsuite/30_threads/mutex/try_lock/1.cc: Likewise. * testsuite/30_threads/mutex/try_lock/2.cc: Likewise. * testsuite/30_threads/mutex/lock/1.cc: Likewise. * testsuite/30_threads/mutex/unlock/1.cc: Likewise. * testsuite/30_threads/recursive_mutex/dest/destructor_locked.cc: Likewise. * testsuite/30_threads/recursive_mutex/native_handle/1.cc: Likewise. * testsuite/30_threads/recursive_mutex/cons/1.cc: Likewise. * testsuite/30_threads/recursive_mutex/requirements/typedefs.cc: Likewise. * testsuite/30_threads/recursive_mutex/try_lock/1.cc: Likewise. * testsuite/30_threads/recursive_mutex/try_lock/2.cc: Likewise. * testsuite/30_threads/recursive_mutex/lock/1.cc: Likewise. * testsuite/30_threads/recursive_mutex/unlock/1.cc: Likewise. * testsuite/30_threads/unique_lock/requirements/ explicit_instantiation.cc: Likewise. * testsuite/30_threads/unique_lock/requirements/typedefs.cc: Likewise. * testsuite/30_threads/mutex/cons/assign_neg.cc: Also adjust dg-error lines for deleted members. * testsuite/30_threads/mutex/cons/copy_neg.cc: Likewise. * testsuite/30_threads/recursive_mutex/cons/assign_neg.cc: Likewise. * testsuite/30_threads/recursive_mutex/cons/copy_neg.cc: Likewise. * testsuite/30_threads/call_once/once_flag.cc: New. * testsuite/30_threads/call_once/call_once1.cc: Likewise. * testsuite/30_threads/condition_variable/cons/1.cc: Likewise. * testsuite/30_threads/condition_variable/cons/copy_neg.cc: Likewise * testsuite/30_threads/condition_variable/cons/assign_neg.cc: Likewise. * testsuite/30_threads/condition_variable_any/cons/1.cc: Likewise. * testsuite/30_threads/condition_variable_any/cons/copy_neg.cc: Likewise. * testsuite/30_threads/condition_variable_any/cons/assign_neg.cc: Likewise. * testsuite/30_threads/timed_mutex/dest/destructor_locked.cc: Likewise. * testsuite/30_threads/timed_mutex/native_handle/1.cc: Likewise. * testsuite/30_threads/timed_mutex/try_lock_until/1.cc: Likewise. * testsuite/30_threads/timed_mutex/try_lock_until/2.cc: Likewise. * testsuite/30_threads/timed_mutex/cons/assign_neg.cc: Likewise. * testsuite/30_threads/timed_mutex/cons/1.cc: Likewise. * testsuite/30_threads/timed_mutex/cons/copy_neg.cc: Likewise. * testsuite/30_threads/timed_mutex/requirements/typedefs.cc: Likewise. * testsuite/30_threads/timed_mutex/try_lock/1.cc: Likewise. * testsuite/30_threads/timed_mutex/try_lock/2.cc: Likewise. * testsuite/30_threads/timed_mutex/lock/1.cc: Likewise. * testsuite/30_threads/timed_mutex/unlock/1.cc: Likewise. * testsuite/30_threads/timed_mutex/try_lock_for/1.cc: Likewise. * testsuite/30_threads/timed_mutex/try_lock_for/2.cc: Likewise. * testsuite/30_threads/timed_mutex/try_lock_for/3.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/dest/destructor_locked.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/try_lock_until/1.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/try_lock_until/2.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/native_handle/1.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/cons: Likewise. * testsuite/30_threads/recursive_timed_mutex/cons/assign_neg.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/cons/1.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/cons/copy_neg.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/requirements/typedefs.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/try_lock/1.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/try_lock/2.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/lock/1.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/lock/2.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/unlock/1.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/try_lock_for/1.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/try_lock_for/2.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/try_lock_for/3.cc: Likewise. * testsuite/30_threads/unique_lock/modifiers/1.cc: Likewise. * testsuite/30_threads/unique_lock/modifiers/2.cc: Likewise. * testsuite/30_threads/unique_lock/cons/1.cc: Likewise. * testsuite/30_threads/unique_lock/cons/2.cc: Likewise. * testsuite/30_threads/unique_lock/cons/3.cc: Likewise. * testsuite/30_threads/unique_lock/cons/4.cc: Likewise. * testsuite/30_threads/unique_lock/cons/5.cc: Likewise. * testsuite/30_threads/unique_lock/cons/6.cc: Likewise. * testsuite/30_threads/unique_lock/locking/1.cc: Likewise. * testsuite/30_threads/unique_lock/locking/2.cc: Likewise. * testsuite/30_threads/unique_lock/locking/3.cc: Likewise. * testsuite/30_threads/unique_lock/locking/4.cc: Likewise. From-SVN: r139943
2008-09-03 19:46:09 +02:00
{ return &_M_cond; }
condition_variable: New. 2008-05-06 Benjamin Kosnik <bkoz@redhat.com> * include/std/condition_variable: New. * include/std/mutex: New. * src/condition_variable.cc: New. * src/mutex.cc: New. * include/bits/functexcept.h: Add __throw_system_error varients. * src/functexcept.cc: Same. * config/abi/pre/gnu.ver: Add exports. * doc/xml/manual/using.xml: Add new includes. * doc/doxygen/user.cfg.in: Doxygen support. * doc/doxygen/doxygroups.cc: Same. * include/Makefile.am: Add mutex, condition_variable. * include/Makefile.in: Regenerated. * src/Makefile.am: Add mutex.cc, condition_variable.cc. * src/Makefile.in: Regenerated. * testsuite/30_threads: New. * testsuite/30_threads/lock_error: New. * testsuite/30_threads/mutex: New. * testsuite/30_threads/mutex/dest: New. * testsuite/30_threads/mutex/dest/destructor_locked.cc: New. * testsuite/30_threads/mutex/native_handle: New. * testsuite/30_threads/mutex/native_handle/1.cc: New. * testsuite/30_threads/mutex/cons: New. * testsuite/30_threads/mutex/cons/assign_neg.cc: New. * testsuite/30_threads/mutex/cons/1.cc: New. * testsuite/30_threads/mutex/cons/copy_neg.cc: New. * testsuite/30_threads/mutex/requirements: New. * testsuite/30_threads/mutex/requirements/typedefs.cc: New. * testsuite/30_threads/mutex/try_lock: New. * testsuite/30_threads/mutex/try_lock/1.cc: New. * testsuite/30_threads/mutex/try_lock/2.cc: New. * testsuite/30_threads/mutex/lock: New. * testsuite/30_threads/mutex/lock/1.cc: New. * testsuite/30_threads/mutex/unlock: New. * testsuite/30_threads/mutex/unlock/1.cc: New. * testsuite/30_threads/recursive_mutex: New. * testsuite/30_threads/recursive_mutex/dest: New. * testsuite/30_threads/recursive_mutex/dest/destructor_locked.cc: New. * testsuite/30_threads/recursive_mutex/native_handle: New. * testsuite/30_threads/recursive_mutex/native_handle/1.cc: New. * testsuite/30_threads/recursive_mutex/cons: New. * testsuite/30_threads/recursive_mutex/cons/assign_neg.cc: New. * testsuite/30_threads/recursive_mutex/cons/1.cc: New. * testsuite/30_threads/recursive_mutex/cons/copy_neg.cc: New. * testsuite/30_threads/recursive_mutex/requirements: New. * testsuite/30_threads/recursive_mutex/requirements/typedefs.cc: New. * testsuite/30_threads/lock_guard: New. * testsuite/30_threads/lock_guard/requirements: New. * testsuite/30_threads/lock_guard/requirements/typedefs.cc: New. * testsuite/30_threads/lock_guard/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/headers: New. * testsuite/30_threads/headers/mutex: New. * testsuite/30_threads/headers/mutex/types_std_c++0x.cc: New. * testsuite/30_threads/headers/mutex/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/condition_variable: New. * testsuite/30_threads/headers/condition_variable/ types_std_c++0x.cc: New. * testsuite/30_threads/headers/condition_variable/std_c++0x_neg.cc: New. * testsuite/30_threads/once_flag: New. * testsuite/30_threads/unique_lock: New. * testsuite/30_threads/unique_lock/requirements: New. * testsuite/30_threads/unique_lock/requirements/typedefs.cc: New. * testsuite/30_threads/unique_lock/requirements/ explicit_instantiation.cc: New. * testsuite/17_intro/headers/c++200x/all.cc: Add new includes. From-SVN: r135007
2008-05-06 23:11:47 +02:00
private:
template<typename _Dur>
cv_status
__wait_until_impl(unique_lock<mutex>& __lock,
const chrono::time_point<__clock_t, _Dur>& __atime)
{
auto __s = chrono::time_point_cast<chrono::seconds>(__atime);
auto __ns = chrono::duration_cast<chrono::nanoseconds>(__atime - __s);
__gthread_time_t __ts =
{
static_cast<std::time_t>(__s.time_since_epoch().count()),
static_cast<long>(__ns.count())
};
__gthread_cond_timedwait(&_M_cond, __lock.mutex()->native_handle(),
&__ts);
return (__clock_t::now() < __atime
? cv_status::no_timeout : cv_status::timeout);
}
condition_variable: New. 2008-05-06 Benjamin Kosnik <bkoz@redhat.com> * include/std/condition_variable: New. * include/std/mutex: New. * src/condition_variable.cc: New. * src/mutex.cc: New. * include/bits/functexcept.h: Add __throw_system_error varients. * src/functexcept.cc: Same. * config/abi/pre/gnu.ver: Add exports. * doc/xml/manual/using.xml: Add new includes. * doc/doxygen/user.cfg.in: Doxygen support. * doc/doxygen/doxygroups.cc: Same. * include/Makefile.am: Add mutex, condition_variable. * include/Makefile.in: Regenerated. * src/Makefile.am: Add mutex.cc, condition_variable.cc. * src/Makefile.in: Regenerated. * testsuite/30_threads: New. * testsuite/30_threads/lock_error: New. * testsuite/30_threads/mutex: New. * testsuite/30_threads/mutex/dest: New. * testsuite/30_threads/mutex/dest/destructor_locked.cc: New. * testsuite/30_threads/mutex/native_handle: New. * testsuite/30_threads/mutex/native_handle/1.cc: New. * testsuite/30_threads/mutex/cons: New. * testsuite/30_threads/mutex/cons/assign_neg.cc: New. * testsuite/30_threads/mutex/cons/1.cc: New. * testsuite/30_threads/mutex/cons/copy_neg.cc: New. * testsuite/30_threads/mutex/requirements: New. * testsuite/30_threads/mutex/requirements/typedefs.cc: New. * testsuite/30_threads/mutex/try_lock: New. * testsuite/30_threads/mutex/try_lock/1.cc: New. * testsuite/30_threads/mutex/try_lock/2.cc: New. * testsuite/30_threads/mutex/lock: New. * testsuite/30_threads/mutex/lock/1.cc: New. * testsuite/30_threads/mutex/unlock: New. * testsuite/30_threads/mutex/unlock/1.cc: New. * testsuite/30_threads/recursive_mutex: New. * testsuite/30_threads/recursive_mutex/dest: New. * testsuite/30_threads/recursive_mutex/dest/destructor_locked.cc: New. * testsuite/30_threads/recursive_mutex/native_handle: New. * testsuite/30_threads/recursive_mutex/native_handle/1.cc: New. * testsuite/30_threads/recursive_mutex/cons: New. * testsuite/30_threads/recursive_mutex/cons/assign_neg.cc: New. * testsuite/30_threads/recursive_mutex/cons/1.cc: New. * testsuite/30_threads/recursive_mutex/cons/copy_neg.cc: New. * testsuite/30_threads/recursive_mutex/requirements: New. * testsuite/30_threads/recursive_mutex/requirements/typedefs.cc: New. * testsuite/30_threads/lock_guard: New. * testsuite/30_threads/lock_guard/requirements: New. * testsuite/30_threads/lock_guard/requirements/typedefs.cc: New. * testsuite/30_threads/lock_guard/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/headers: New. * testsuite/30_threads/headers/mutex: New. * testsuite/30_threads/headers/mutex/types_std_c++0x.cc: New. * testsuite/30_threads/headers/mutex/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/condition_variable: New. * testsuite/30_threads/headers/condition_variable/ types_std_c++0x.cc: New. * testsuite/30_threads/headers/condition_variable/std_c++0x_neg.cc: New. * testsuite/30_threads/once_flag: New. * testsuite/30_threads/unique_lock: New. * testsuite/30_threads/unique_lock/requirements: New. * testsuite/30_threads/unique_lock/requirements/typedefs.cc: New. * testsuite/30_threads/unique_lock/requirements/ explicit_instantiation.cc: New. * testsuite/17_intro/headers/c++200x/all.cc: Add new includes. From-SVN: r135007
2008-05-06 23:11:47 +02:00
};
/// condition_variable_any
// Like above, but mutex is not required to have try_lock.
condition_variable: New. 2008-05-06 Benjamin Kosnik <bkoz@redhat.com> * include/std/condition_variable: New. * include/std/mutex: New. * src/condition_variable.cc: New. * src/mutex.cc: New. * include/bits/functexcept.h: Add __throw_system_error varients. * src/functexcept.cc: Same. * config/abi/pre/gnu.ver: Add exports. * doc/xml/manual/using.xml: Add new includes. * doc/doxygen/user.cfg.in: Doxygen support. * doc/doxygen/doxygroups.cc: Same. * include/Makefile.am: Add mutex, condition_variable. * include/Makefile.in: Regenerated. * src/Makefile.am: Add mutex.cc, condition_variable.cc. * src/Makefile.in: Regenerated. * testsuite/30_threads: New. * testsuite/30_threads/lock_error: New. * testsuite/30_threads/mutex: New. * testsuite/30_threads/mutex/dest: New. * testsuite/30_threads/mutex/dest/destructor_locked.cc: New. * testsuite/30_threads/mutex/native_handle: New. * testsuite/30_threads/mutex/native_handle/1.cc: New. * testsuite/30_threads/mutex/cons: New. * testsuite/30_threads/mutex/cons/assign_neg.cc: New. * testsuite/30_threads/mutex/cons/1.cc: New. * testsuite/30_threads/mutex/cons/copy_neg.cc: New. * testsuite/30_threads/mutex/requirements: New. * testsuite/30_threads/mutex/requirements/typedefs.cc: New. * testsuite/30_threads/mutex/try_lock: New. * testsuite/30_threads/mutex/try_lock/1.cc: New. * testsuite/30_threads/mutex/try_lock/2.cc: New. * testsuite/30_threads/mutex/lock: New. * testsuite/30_threads/mutex/lock/1.cc: New. * testsuite/30_threads/mutex/unlock: New. * testsuite/30_threads/mutex/unlock/1.cc: New. * testsuite/30_threads/recursive_mutex: New. * testsuite/30_threads/recursive_mutex/dest: New. * testsuite/30_threads/recursive_mutex/dest/destructor_locked.cc: New. * testsuite/30_threads/recursive_mutex/native_handle: New. * testsuite/30_threads/recursive_mutex/native_handle/1.cc: New. * testsuite/30_threads/recursive_mutex/cons: New. * testsuite/30_threads/recursive_mutex/cons/assign_neg.cc: New. * testsuite/30_threads/recursive_mutex/cons/1.cc: New. * testsuite/30_threads/recursive_mutex/cons/copy_neg.cc: New. * testsuite/30_threads/recursive_mutex/requirements: New. * testsuite/30_threads/recursive_mutex/requirements/typedefs.cc: New. * testsuite/30_threads/lock_guard: New. * testsuite/30_threads/lock_guard/requirements: New. * testsuite/30_threads/lock_guard/requirements/typedefs.cc: New. * testsuite/30_threads/lock_guard/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/headers: New. * testsuite/30_threads/headers/mutex: New. * testsuite/30_threads/headers/mutex/types_std_c++0x.cc: New. * testsuite/30_threads/headers/mutex/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/condition_variable: New. * testsuite/30_threads/headers/condition_variable/ types_std_c++0x.cc: New. * testsuite/30_threads/headers/condition_variable/std_c++0x_neg.cc: New. * testsuite/30_threads/once_flag: New. * testsuite/30_threads/unique_lock: New. * testsuite/30_threads/unique_lock/requirements: New. * testsuite/30_threads/unique_lock/requirements/typedefs.cc: New. * testsuite/30_threads/unique_lock/requirements/ explicit_instantiation.cc: New. * testsuite/17_intro/headers/c++200x/all.cc: Add new includes. From-SVN: r135007
2008-05-06 23:11:47 +02:00
class condition_variable_any
{
typedef chrono::system_clock __clock_t;
condition_variable _M_cond;
mutex _M_mutex;
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
2009-02-10 09:29:57 +01:00
// scoped unlock - unlocks in ctor, re-locks in dtor
template<typename _Lock>
struct _Unlock
{
explicit _Unlock(_Lock& __lk) : _M_lock(__lk) { __lk.unlock(); }
~_Unlock() noexcept(false)
{
if (uncaught_exception())
__try { _M_lock.lock(); } __catch(...) { }
else
_M_lock.lock();
}
_Unlock(const _Unlock&) = delete;
_Unlock& operator=(const _Unlock&) = delete;
_Lock& _M_lock;
};
condition_variable: New. 2008-05-06 Benjamin Kosnik <bkoz@redhat.com> * include/std/condition_variable: New. * include/std/mutex: New. * src/condition_variable.cc: New. * src/mutex.cc: New. * include/bits/functexcept.h: Add __throw_system_error varients. * src/functexcept.cc: Same. * config/abi/pre/gnu.ver: Add exports. * doc/xml/manual/using.xml: Add new includes. * doc/doxygen/user.cfg.in: Doxygen support. * doc/doxygen/doxygroups.cc: Same. * include/Makefile.am: Add mutex, condition_variable. * include/Makefile.in: Regenerated. * src/Makefile.am: Add mutex.cc, condition_variable.cc. * src/Makefile.in: Regenerated. * testsuite/30_threads: New. * testsuite/30_threads/lock_error: New. * testsuite/30_threads/mutex: New. * testsuite/30_threads/mutex/dest: New. * testsuite/30_threads/mutex/dest/destructor_locked.cc: New. * testsuite/30_threads/mutex/native_handle: New. * testsuite/30_threads/mutex/native_handle/1.cc: New. * testsuite/30_threads/mutex/cons: New. * testsuite/30_threads/mutex/cons/assign_neg.cc: New. * testsuite/30_threads/mutex/cons/1.cc: New. * testsuite/30_threads/mutex/cons/copy_neg.cc: New. * testsuite/30_threads/mutex/requirements: New. * testsuite/30_threads/mutex/requirements/typedefs.cc: New. * testsuite/30_threads/mutex/try_lock: New. * testsuite/30_threads/mutex/try_lock/1.cc: New. * testsuite/30_threads/mutex/try_lock/2.cc: New. * testsuite/30_threads/mutex/lock: New. * testsuite/30_threads/mutex/lock/1.cc: New. * testsuite/30_threads/mutex/unlock: New. * testsuite/30_threads/mutex/unlock/1.cc: New. * testsuite/30_threads/recursive_mutex: New. * testsuite/30_threads/recursive_mutex/dest: New. * testsuite/30_threads/recursive_mutex/dest/destructor_locked.cc: New. * testsuite/30_threads/recursive_mutex/native_handle: New. * testsuite/30_threads/recursive_mutex/native_handle/1.cc: New. * testsuite/30_threads/recursive_mutex/cons: New. * testsuite/30_threads/recursive_mutex/cons/assign_neg.cc: New. * testsuite/30_threads/recursive_mutex/cons/1.cc: New. * testsuite/30_threads/recursive_mutex/cons/copy_neg.cc: New. * testsuite/30_threads/recursive_mutex/requirements: New. * testsuite/30_threads/recursive_mutex/requirements/typedefs.cc: New. * testsuite/30_threads/lock_guard: New. * testsuite/30_threads/lock_guard/requirements: New. * testsuite/30_threads/lock_guard/requirements/typedefs.cc: New. * testsuite/30_threads/lock_guard/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/headers: New. * testsuite/30_threads/headers/mutex: New. * testsuite/30_threads/headers/mutex/types_std_c++0x.cc: New. * testsuite/30_threads/headers/mutex/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/condition_variable: New. * testsuite/30_threads/headers/condition_variable/ types_std_c++0x.cc: New. * testsuite/30_threads/headers/condition_variable/std_c++0x_neg.cc: New. * testsuite/30_threads/once_flag: New. * testsuite/30_threads/unique_lock: New. * testsuite/30_threads/unique_lock/requirements: New. * testsuite/30_threads/unique_lock/requirements/typedefs.cc: New. * testsuite/30_threads/unique_lock/requirements/ explicit_instantiation.cc: New. * testsuite/17_intro/headers/c++200x/all.cc: Add new includes. From-SVN: r135007
2008-05-06 23:11:47 +02:00
public:
condition_variable_any() noexcept;
~condition_variable_any() noexcept;
condition_variable: Use new deleted ctors. 2008-09-03 Chris Fairles <chris.fairles@gmail.com> * include/std/condition_variable: Use new deleted ctors. * include/std/mutex: Likewise plus implement timed_mutex, recursive_timed_mutex and call_once. * src/condition_variable.cc: Implement wait(). Use gthread types. Remove _GTHREADS_HAS_COND checks in favor of global _GLIBCXX_HAS_GTHREADS. * src/mutex.cc (call_once): Implementation using TLS with mutex fallback. * config/abi/pre/gnu.ver: Add exported symbols. * testsuite/lib/libstdc++.exp (check_v3_target_gthreads): New. * testsuite/lib/dg-options.exp (dg-require-gthreads): Likewise. * testsuite/30_threads/lock_guard/requirements/typedefs.cc: Use dg-require-gthreads and dg-require-cstdint. * testsuite/30_threads/lock_guard/requirements/ explicit_instantiation.cc: Likewise. * testsuite/30_threads/mutex/dest/destructor_locked.cc: Likewise. * testsuite/30_threads/mutex/native_handle/1.cc: Likewise. * testsuite/30_threads/mutex/cons/1.cc: Likewise. * testsuite/30_threads/mutex/requirements/typedefs.cc: Likewise. * testsuite/30_threads/mutex/try_lock/1.cc: Likewise. * testsuite/30_threads/mutex/try_lock/2.cc: Likewise. * testsuite/30_threads/mutex/lock/1.cc: Likewise. * testsuite/30_threads/mutex/unlock/1.cc: Likewise. * testsuite/30_threads/recursive_mutex/dest/destructor_locked.cc: Likewise. * testsuite/30_threads/recursive_mutex/native_handle/1.cc: Likewise. * testsuite/30_threads/recursive_mutex/cons/1.cc: Likewise. * testsuite/30_threads/recursive_mutex/requirements/typedefs.cc: Likewise. * testsuite/30_threads/recursive_mutex/try_lock/1.cc: Likewise. * testsuite/30_threads/recursive_mutex/try_lock/2.cc: Likewise. * testsuite/30_threads/recursive_mutex/lock/1.cc: Likewise. * testsuite/30_threads/recursive_mutex/unlock/1.cc: Likewise. * testsuite/30_threads/unique_lock/requirements/ explicit_instantiation.cc: Likewise. * testsuite/30_threads/unique_lock/requirements/typedefs.cc: Likewise. * testsuite/30_threads/mutex/cons/assign_neg.cc: Also adjust dg-error lines for deleted members. * testsuite/30_threads/mutex/cons/copy_neg.cc: Likewise. * testsuite/30_threads/recursive_mutex/cons/assign_neg.cc: Likewise. * testsuite/30_threads/recursive_mutex/cons/copy_neg.cc: Likewise. * testsuite/30_threads/call_once/once_flag.cc: New. * testsuite/30_threads/call_once/call_once1.cc: Likewise. * testsuite/30_threads/condition_variable/cons/1.cc: Likewise. * testsuite/30_threads/condition_variable/cons/copy_neg.cc: Likewise * testsuite/30_threads/condition_variable/cons/assign_neg.cc: Likewise. * testsuite/30_threads/condition_variable_any/cons/1.cc: Likewise. * testsuite/30_threads/condition_variable_any/cons/copy_neg.cc: Likewise. * testsuite/30_threads/condition_variable_any/cons/assign_neg.cc: Likewise. * testsuite/30_threads/timed_mutex/dest/destructor_locked.cc: Likewise. * testsuite/30_threads/timed_mutex/native_handle/1.cc: Likewise. * testsuite/30_threads/timed_mutex/try_lock_until/1.cc: Likewise. * testsuite/30_threads/timed_mutex/try_lock_until/2.cc: Likewise. * testsuite/30_threads/timed_mutex/cons/assign_neg.cc: Likewise. * testsuite/30_threads/timed_mutex/cons/1.cc: Likewise. * testsuite/30_threads/timed_mutex/cons/copy_neg.cc: Likewise. * testsuite/30_threads/timed_mutex/requirements/typedefs.cc: Likewise. * testsuite/30_threads/timed_mutex/try_lock/1.cc: Likewise. * testsuite/30_threads/timed_mutex/try_lock/2.cc: Likewise. * testsuite/30_threads/timed_mutex/lock/1.cc: Likewise. * testsuite/30_threads/timed_mutex/unlock/1.cc: Likewise. * testsuite/30_threads/timed_mutex/try_lock_for/1.cc: Likewise. * testsuite/30_threads/timed_mutex/try_lock_for/2.cc: Likewise. * testsuite/30_threads/timed_mutex/try_lock_for/3.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/dest/destructor_locked.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/try_lock_until/1.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/try_lock_until/2.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/native_handle/1.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/cons: Likewise. * testsuite/30_threads/recursive_timed_mutex/cons/assign_neg.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/cons/1.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/cons/copy_neg.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/requirements/typedefs.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/try_lock/1.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/try_lock/2.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/lock/1.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/lock/2.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/unlock/1.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/try_lock_for/1.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/try_lock_for/2.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/try_lock_for/3.cc: Likewise. * testsuite/30_threads/unique_lock/modifiers/1.cc: Likewise. * testsuite/30_threads/unique_lock/modifiers/2.cc: Likewise. * testsuite/30_threads/unique_lock/cons/1.cc: Likewise. * testsuite/30_threads/unique_lock/cons/2.cc: Likewise. * testsuite/30_threads/unique_lock/cons/3.cc: Likewise. * testsuite/30_threads/unique_lock/cons/4.cc: Likewise. * testsuite/30_threads/unique_lock/cons/5.cc: Likewise. * testsuite/30_threads/unique_lock/cons/6.cc: Likewise. * testsuite/30_threads/unique_lock/locking/1.cc: Likewise. * testsuite/30_threads/unique_lock/locking/2.cc: Likewise. * testsuite/30_threads/unique_lock/locking/3.cc: Likewise. * testsuite/30_threads/unique_lock/locking/4.cc: Likewise. From-SVN: r139943
2008-09-03 19:46:09 +02:00
condition_variable_any(const condition_variable_any&) = delete;
condition_variable_any& operator=(const condition_variable_any&) = delete;
condition_variable: New. 2008-05-06 Benjamin Kosnik <bkoz@redhat.com> * include/std/condition_variable: New. * include/std/mutex: New. * src/condition_variable.cc: New. * src/mutex.cc: New. * include/bits/functexcept.h: Add __throw_system_error varients. * src/functexcept.cc: Same. * config/abi/pre/gnu.ver: Add exports. * doc/xml/manual/using.xml: Add new includes. * doc/doxygen/user.cfg.in: Doxygen support. * doc/doxygen/doxygroups.cc: Same. * include/Makefile.am: Add mutex, condition_variable. * include/Makefile.in: Regenerated. * src/Makefile.am: Add mutex.cc, condition_variable.cc. * src/Makefile.in: Regenerated. * testsuite/30_threads: New. * testsuite/30_threads/lock_error: New. * testsuite/30_threads/mutex: New. * testsuite/30_threads/mutex/dest: New. * testsuite/30_threads/mutex/dest/destructor_locked.cc: New. * testsuite/30_threads/mutex/native_handle: New. * testsuite/30_threads/mutex/native_handle/1.cc: New. * testsuite/30_threads/mutex/cons: New. * testsuite/30_threads/mutex/cons/assign_neg.cc: New. * testsuite/30_threads/mutex/cons/1.cc: New. * testsuite/30_threads/mutex/cons/copy_neg.cc: New. * testsuite/30_threads/mutex/requirements: New. * testsuite/30_threads/mutex/requirements/typedefs.cc: New. * testsuite/30_threads/mutex/try_lock: New. * testsuite/30_threads/mutex/try_lock/1.cc: New. * testsuite/30_threads/mutex/try_lock/2.cc: New. * testsuite/30_threads/mutex/lock: New. * testsuite/30_threads/mutex/lock/1.cc: New. * testsuite/30_threads/mutex/unlock: New. * testsuite/30_threads/mutex/unlock/1.cc: New. * testsuite/30_threads/recursive_mutex: New. * testsuite/30_threads/recursive_mutex/dest: New. * testsuite/30_threads/recursive_mutex/dest/destructor_locked.cc: New. * testsuite/30_threads/recursive_mutex/native_handle: New. * testsuite/30_threads/recursive_mutex/native_handle/1.cc: New. * testsuite/30_threads/recursive_mutex/cons: New. * testsuite/30_threads/recursive_mutex/cons/assign_neg.cc: New. * testsuite/30_threads/recursive_mutex/cons/1.cc: New. * testsuite/30_threads/recursive_mutex/cons/copy_neg.cc: New. * testsuite/30_threads/recursive_mutex/requirements: New. * testsuite/30_threads/recursive_mutex/requirements/typedefs.cc: New. * testsuite/30_threads/lock_guard: New. * testsuite/30_threads/lock_guard/requirements: New. * testsuite/30_threads/lock_guard/requirements/typedefs.cc: New. * testsuite/30_threads/lock_guard/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/headers: New. * testsuite/30_threads/headers/mutex: New. * testsuite/30_threads/headers/mutex/types_std_c++0x.cc: New. * testsuite/30_threads/headers/mutex/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/condition_variable: New. * testsuite/30_threads/headers/condition_variable/ types_std_c++0x.cc: New. * testsuite/30_threads/headers/condition_variable/std_c++0x_neg.cc: New. * testsuite/30_threads/once_flag: New. * testsuite/30_threads/unique_lock: New. * testsuite/30_threads/unique_lock/requirements: New. * testsuite/30_threads/unique_lock/requirements/typedefs.cc: New. * testsuite/30_threads/unique_lock/requirements/ explicit_instantiation.cc: New. * testsuite/17_intro/headers/c++200x/all.cc: Add new includes. From-SVN: r135007
2008-05-06 23:11:47 +02:00
void
notify_one() noexcept
{
lock_guard<mutex> __lock(_M_mutex);
_M_cond.notify_one();
}
condition_variable: New. 2008-05-06 Benjamin Kosnik <bkoz@redhat.com> * include/std/condition_variable: New. * include/std/mutex: New. * src/condition_variable.cc: New. * src/mutex.cc: New. * include/bits/functexcept.h: Add __throw_system_error varients. * src/functexcept.cc: Same. * config/abi/pre/gnu.ver: Add exports. * doc/xml/manual/using.xml: Add new includes. * doc/doxygen/user.cfg.in: Doxygen support. * doc/doxygen/doxygroups.cc: Same. * include/Makefile.am: Add mutex, condition_variable. * include/Makefile.in: Regenerated. * src/Makefile.am: Add mutex.cc, condition_variable.cc. * src/Makefile.in: Regenerated. * testsuite/30_threads: New. * testsuite/30_threads/lock_error: New. * testsuite/30_threads/mutex: New. * testsuite/30_threads/mutex/dest: New. * testsuite/30_threads/mutex/dest/destructor_locked.cc: New. * testsuite/30_threads/mutex/native_handle: New. * testsuite/30_threads/mutex/native_handle/1.cc: New. * testsuite/30_threads/mutex/cons: New. * testsuite/30_threads/mutex/cons/assign_neg.cc: New. * testsuite/30_threads/mutex/cons/1.cc: New. * testsuite/30_threads/mutex/cons/copy_neg.cc: New. * testsuite/30_threads/mutex/requirements: New. * testsuite/30_threads/mutex/requirements/typedefs.cc: New. * testsuite/30_threads/mutex/try_lock: New. * testsuite/30_threads/mutex/try_lock/1.cc: New. * testsuite/30_threads/mutex/try_lock/2.cc: New. * testsuite/30_threads/mutex/lock: New. * testsuite/30_threads/mutex/lock/1.cc: New. * testsuite/30_threads/mutex/unlock: New. * testsuite/30_threads/mutex/unlock/1.cc: New. * testsuite/30_threads/recursive_mutex: New. * testsuite/30_threads/recursive_mutex/dest: New. * testsuite/30_threads/recursive_mutex/dest/destructor_locked.cc: New. * testsuite/30_threads/recursive_mutex/native_handle: New. * testsuite/30_threads/recursive_mutex/native_handle/1.cc: New. * testsuite/30_threads/recursive_mutex/cons: New. * testsuite/30_threads/recursive_mutex/cons/assign_neg.cc: New. * testsuite/30_threads/recursive_mutex/cons/1.cc: New. * testsuite/30_threads/recursive_mutex/cons/copy_neg.cc: New. * testsuite/30_threads/recursive_mutex/requirements: New. * testsuite/30_threads/recursive_mutex/requirements/typedefs.cc: New. * testsuite/30_threads/lock_guard: New. * testsuite/30_threads/lock_guard/requirements: New. * testsuite/30_threads/lock_guard/requirements/typedefs.cc: New. * testsuite/30_threads/lock_guard/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/headers: New. * testsuite/30_threads/headers/mutex: New. * testsuite/30_threads/headers/mutex/types_std_c++0x.cc: New. * testsuite/30_threads/headers/mutex/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/condition_variable: New. * testsuite/30_threads/headers/condition_variable/ types_std_c++0x.cc: New. * testsuite/30_threads/headers/condition_variable/std_c++0x_neg.cc: New. * testsuite/30_threads/once_flag: New. * testsuite/30_threads/unique_lock: New. * testsuite/30_threads/unique_lock/requirements: New. * testsuite/30_threads/unique_lock/requirements/typedefs.cc: New. * testsuite/30_threads/unique_lock/requirements/ explicit_instantiation.cc: New. * testsuite/17_intro/headers/c++200x/all.cc: Add new includes. From-SVN: r135007
2008-05-06 23:11:47 +02:00
void
notify_all() noexcept
{
lock_guard<mutex> __lock(_M_mutex);
_M_cond.notify_all();
}
condition_variable: New. 2008-05-06 Benjamin Kosnik <bkoz@redhat.com> * include/std/condition_variable: New. * include/std/mutex: New. * src/condition_variable.cc: New. * src/mutex.cc: New. * include/bits/functexcept.h: Add __throw_system_error varients. * src/functexcept.cc: Same. * config/abi/pre/gnu.ver: Add exports. * doc/xml/manual/using.xml: Add new includes. * doc/doxygen/user.cfg.in: Doxygen support. * doc/doxygen/doxygroups.cc: Same. * include/Makefile.am: Add mutex, condition_variable. * include/Makefile.in: Regenerated. * src/Makefile.am: Add mutex.cc, condition_variable.cc. * src/Makefile.in: Regenerated. * testsuite/30_threads: New. * testsuite/30_threads/lock_error: New. * testsuite/30_threads/mutex: New. * testsuite/30_threads/mutex/dest: New. * testsuite/30_threads/mutex/dest/destructor_locked.cc: New. * testsuite/30_threads/mutex/native_handle: New. * testsuite/30_threads/mutex/native_handle/1.cc: New. * testsuite/30_threads/mutex/cons: New. * testsuite/30_threads/mutex/cons/assign_neg.cc: New. * testsuite/30_threads/mutex/cons/1.cc: New. * testsuite/30_threads/mutex/cons/copy_neg.cc: New. * testsuite/30_threads/mutex/requirements: New. * testsuite/30_threads/mutex/requirements/typedefs.cc: New. * testsuite/30_threads/mutex/try_lock: New. * testsuite/30_threads/mutex/try_lock/1.cc: New. * testsuite/30_threads/mutex/try_lock/2.cc: New. * testsuite/30_threads/mutex/lock: New. * testsuite/30_threads/mutex/lock/1.cc: New. * testsuite/30_threads/mutex/unlock: New. * testsuite/30_threads/mutex/unlock/1.cc: New. * testsuite/30_threads/recursive_mutex: New. * testsuite/30_threads/recursive_mutex/dest: New. * testsuite/30_threads/recursive_mutex/dest/destructor_locked.cc: New. * testsuite/30_threads/recursive_mutex/native_handle: New. * testsuite/30_threads/recursive_mutex/native_handle/1.cc: New. * testsuite/30_threads/recursive_mutex/cons: New. * testsuite/30_threads/recursive_mutex/cons/assign_neg.cc: New. * testsuite/30_threads/recursive_mutex/cons/1.cc: New. * testsuite/30_threads/recursive_mutex/cons/copy_neg.cc: New. * testsuite/30_threads/recursive_mutex/requirements: New. * testsuite/30_threads/recursive_mutex/requirements/typedefs.cc: New. * testsuite/30_threads/lock_guard: New. * testsuite/30_threads/lock_guard/requirements: New. * testsuite/30_threads/lock_guard/requirements/typedefs.cc: New. * testsuite/30_threads/lock_guard/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/headers: New. * testsuite/30_threads/headers/mutex: New. * testsuite/30_threads/headers/mutex/types_std_c++0x.cc: New. * testsuite/30_threads/headers/mutex/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/condition_variable: New. * testsuite/30_threads/headers/condition_variable/ types_std_c++0x.cc: New. * testsuite/30_threads/headers/condition_variable/std_c++0x_neg.cc: New. * testsuite/30_threads/once_flag: New. * testsuite/30_threads/unique_lock: New. * testsuite/30_threads/unique_lock/requirements: New. * testsuite/30_threads/unique_lock/requirements/typedefs.cc: New. * testsuite/30_threads/unique_lock/requirements/ explicit_instantiation.cc: New. * testsuite/17_intro/headers/c++200x/all.cc: Add new includes. From-SVN: r135007
2008-05-06 23:11:47 +02:00
template<typename _Lock>
void
wait(_Lock& __lock)
{
unique_lock<mutex> __my_lock(_M_mutex);
_Unlock<_Lock> __unlock(__lock);
// _M_mutex must be unlocked before re-locking __lock so move
// ownership of _M_mutex lock to an object with shorter lifetime.
unique_lock<mutex> __my_lock2(std::move(__my_lock));
_M_cond.wait(__my_lock2);
}
condition_variable: New. 2008-05-06 Benjamin Kosnik <bkoz@redhat.com> * include/std/condition_variable: New. * include/std/mutex: New. * src/condition_variable.cc: New. * src/mutex.cc: New. * include/bits/functexcept.h: Add __throw_system_error varients. * src/functexcept.cc: Same. * config/abi/pre/gnu.ver: Add exports. * doc/xml/manual/using.xml: Add new includes. * doc/doxygen/user.cfg.in: Doxygen support. * doc/doxygen/doxygroups.cc: Same. * include/Makefile.am: Add mutex, condition_variable. * include/Makefile.in: Regenerated. * src/Makefile.am: Add mutex.cc, condition_variable.cc. * src/Makefile.in: Regenerated. * testsuite/30_threads: New. * testsuite/30_threads/lock_error: New. * testsuite/30_threads/mutex: New. * testsuite/30_threads/mutex/dest: New. * testsuite/30_threads/mutex/dest/destructor_locked.cc: New. * testsuite/30_threads/mutex/native_handle: New. * testsuite/30_threads/mutex/native_handle/1.cc: New. * testsuite/30_threads/mutex/cons: New. * testsuite/30_threads/mutex/cons/assign_neg.cc: New. * testsuite/30_threads/mutex/cons/1.cc: New. * testsuite/30_threads/mutex/cons/copy_neg.cc: New. * testsuite/30_threads/mutex/requirements: New. * testsuite/30_threads/mutex/requirements/typedefs.cc: New. * testsuite/30_threads/mutex/try_lock: New. * testsuite/30_threads/mutex/try_lock/1.cc: New. * testsuite/30_threads/mutex/try_lock/2.cc: New. * testsuite/30_threads/mutex/lock: New. * testsuite/30_threads/mutex/lock/1.cc: New. * testsuite/30_threads/mutex/unlock: New. * testsuite/30_threads/mutex/unlock/1.cc: New. * testsuite/30_threads/recursive_mutex: New. * testsuite/30_threads/recursive_mutex/dest: New. * testsuite/30_threads/recursive_mutex/dest/destructor_locked.cc: New. * testsuite/30_threads/recursive_mutex/native_handle: New. * testsuite/30_threads/recursive_mutex/native_handle/1.cc: New. * testsuite/30_threads/recursive_mutex/cons: New. * testsuite/30_threads/recursive_mutex/cons/assign_neg.cc: New. * testsuite/30_threads/recursive_mutex/cons/1.cc: New. * testsuite/30_threads/recursive_mutex/cons/copy_neg.cc: New. * testsuite/30_threads/recursive_mutex/requirements: New. * testsuite/30_threads/recursive_mutex/requirements/typedefs.cc: New. * testsuite/30_threads/lock_guard: New. * testsuite/30_threads/lock_guard/requirements: New. * testsuite/30_threads/lock_guard/requirements/typedefs.cc: New. * testsuite/30_threads/lock_guard/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/headers: New. * testsuite/30_threads/headers/mutex: New. * testsuite/30_threads/headers/mutex/types_std_c++0x.cc: New. * testsuite/30_threads/headers/mutex/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/condition_variable: New. * testsuite/30_threads/headers/condition_variable/ types_std_c++0x.cc: New. * testsuite/30_threads/headers/condition_variable/std_c++0x_neg.cc: New. * testsuite/30_threads/once_flag: New. * testsuite/30_threads/unique_lock: New. * testsuite/30_threads/unique_lock/requirements: New. * testsuite/30_threads/unique_lock/requirements/typedefs.cc: New. * testsuite/30_threads/unique_lock/requirements/ explicit_instantiation.cc: New. * testsuite/17_intro/headers/c++200x/all.cc: Add new includes. From-SVN: r135007
2008-05-06 23:11:47 +02:00
template<typename _Lock, typename _Predicate>
void
wait(_Lock& __lock, _Predicate __p)
{
while (!__p())
wait(__lock);
}
condition_variable: New. 2008-05-06 Benjamin Kosnik <bkoz@redhat.com> * include/std/condition_variable: New. * include/std/mutex: New. * src/condition_variable.cc: New. * src/mutex.cc: New. * include/bits/functexcept.h: Add __throw_system_error varients. * src/functexcept.cc: Same. * config/abi/pre/gnu.ver: Add exports. * doc/xml/manual/using.xml: Add new includes. * doc/doxygen/user.cfg.in: Doxygen support. * doc/doxygen/doxygroups.cc: Same. * include/Makefile.am: Add mutex, condition_variable. * include/Makefile.in: Regenerated. * src/Makefile.am: Add mutex.cc, condition_variable.cc. * src/Makefile.in: Regenerated. * testsuite/30_threads: New. * testsuite/30_threads/lock_error: New. * testsuite/30_threads/mutex: New. * testsuite/30_threads/mutex/dest: New. * testsuite/30_threads/mutex/dest/destructor_locked.cc: New. * testsuite/30_threads/mutex/native_handle: New. * testsuite/30_threads/mutex/native_handle/1.cc: New. * testsuite/30_threads/mutex/cons: New. * testsuite/30_threads/mutex/cons/assign_neg.cc: New. * testsuite/30_threads/mutex/cons/1.cc: New. * testsuite/30_threads/mutex/cons/copy_neg.cc: New. * testsuite/30_threads/mutex/requirements: New. * testsuite/30_threads/mutex/requirements/typedefs.cc: New. * testsuite/30_threads/mutex/try_lock: New. * testsuite/30_threads/mutex/try_lock/1.cc: New. * testsuite/30_threads/mutex/try_lock/2.cc: New. * testsuite/30_threads/mutex/lock: New. * testsuite/30_threads/mutex/lock/1.cc: New. * testsuite/30_threads/mutex/unlock: New. * testsuite/30_threads/mutex/unlock/1.cc: New. * testsuite/30_threads/recursive_mutex: New. * testsuite/30_threads/recursive_mutex/dest: New. * testsuite/30_threads/recursive_mutex/dest/destructor_locked.cc: New. * testsuite/30_threads/recursive_mutex/native_handle: New. * testsuite/30_threads/recursive_mutex/native_handle/1.cc: New. * testsuite/30_threads/recursive_mutex/cons: New. * testsuite/30_threads/recursive_mutex/cons/assign_neg.cc: New. * testsuite/30_threads/recursive_mutex/cons/1.cc: New. * testsuite/30_threads/recursive_mutex/cons/copy_neg.cc: New. * testsuite/30_threads/recursive_mutex/requirements: New. * testsuite/30_threads/recursive_mutex/requirements/typedefs.cc: New. * testsuite/30_threads/lock_guard: New. * testsuite/30_threads/lock_guard/requirements: New. * testsuite/30_threads/lock_guard/requirements/typedefs.cc: New. * testsuite/30_threads/lock_guard/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/headers: New. * testsuite/30_threads/headers/mutex: New. * testsuite/30_threads/headers/mutex/types_std_c++0x.cc: New. * testsuite/30_threads/headers/mutex/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/condition_variable: New. * testsuite/30_threads/headers/condition_variable/ types_std_c++0x.cc: New. * testsuite/30_threads/headers/condition_variable/std_c++0x_neg.cc: New. * testsuite/30_threads/once_flag: New. * testsuite/30_threads/unique_lock: New. * testsuite/30_threads/unique_lock/requirements: New. * testsuite/30_threads/unique_lock/requirements/typedefs.cc: New. * testsuite/30_threads/unique_lock/requirements/ explicit_instantiation.cc: New. * testsuite/17_intro/headers/c++200x/all.cc: Add new includes. From-SVN: r135007
2008-05-06 23:11:47 +02:00
template<typename _Lock, typename _Clock, typename _Duration>
cv_status
wait_until(_Lock& __lock,
const chrono::time_point<_Clock, _Duration>& __atime)
{
unique_lock<mutex> __my_lock(_M_mutex);
_Unlock<_Lock> __unlock(__lock);
// _M_mutex must be unlocked before re-locking __lock so move
// ownership of _M_mutex lock to an object with shorter lifetime.
unique_lock<mutex> __my_lock2(std::move(__my_lock));
return _M_cond.wait_until(__my_lock2, __atime);
}
condition_variable: New. 2008-05-06 Benjamin Kosnik <bkoz@redhat.com> * include/std/condition_variable: New. * include/std/mutex: New. * src/condition_variable.cc: New. * src/mutex.cc: New. * include/bits/functexcept.h: Add __throw_system_error varients. * src/functexcept.cc: Same. * config/abi/pre/gnu.ver: Add exports. * doc/xml/manual/using.xml: Add new includes. * doc/doxygen/user.cfg.in: Doxygen support. * doc/doxygen/doxygroups.cc: Same. * include/Makefile.am: Add mutex, condition_variable. * include/Makefile.in: Regenerated. * src/Makefile.am: Add mutex.cc, condition_variable.cc. * src/Makefile.in: Regenerated. * testsuite/30_threads: New. * testsuite/30_threads/lock_error: New. * testsuite/30_threads/mutex: New. * testsuite/30_threads/mutex/dest: New. * testsuite/30_threads/mutex/dest/destructor_locked.cc: New. * testsuite/30_threads/mutex/native_handle: New. * testsuite/30_threads/mutex/native_handle/1.cc: New. * testsuite/30_threads/mutex/cons: New. * testsuite/30_threads/mutex/cons/assign_neg.cc: New. * testsuite/30_threads/mutex/cons/1.cc: New. * testsuite/30_threads/mutex/cons/copy_neg.cc: New. * testsuite/30_threads/mutex/requirements: New. * testsuite/30_threads/mutex/requirements/typedefs.cc: New. * testsuite/30_threads/mutex/try_lock: New. * testsuite/30_threads/mutex/try_lock/1.cc: New. * testsuite/30_threads/mutex/try_lock/2.cc: New. * testsuite/30_threads/mutex/lock: New. * testsuite/30_threads/mutex/lock/1.cc: New. * testsuite/30_threads/mutex/unlock: New. * testsuite/30_threads/mutex/unlock/1.cc: New. * testsuite/30_threads/recursive_mutex: New. * testsuite/30_threads/recursive_mutex/dest: New. * testsuite/30_threads/recursive_mutex/dest/destructor_locked.cc: New. * testsuite/30_threads/recursive_mutex/native_handle: New. * testsuite/30_threads/recursive_mutex/native_handle/1.cc: New. * testsuite/30_threads/recursive_mutex/cons: New. * testsuite/30_threads/recursive_mutex/cons/assign_neg.cc: New. * testsuite/30_threads/recursive_mutex/cons/1.cc: New. * testsuite/30_threads/recursive_mutex/cons/copy_neg.cc: New. * testsuite/30_threads/recursive_mutex/requirements: New. * testsuite/30_threads/recursive_mutex/requirements/typedefs.cc: New. * testsuite/30_threads/lock_guard: New. * testsuite/30_threads/lock_guard/requirements: New. * testsuite/30_threads/lock_guard/requirements/typedefs.cc: New. * testsuite/30_threads/lock_guard/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/headers: New. * testsuite/30_threads/headers/mutex: New. * testsuite/30_threads/headers/mutex/types_std_c++0x.cc: New. * testsuite/30_threads/headers/mutex/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/condition_variable: New. * testsuite/30_threads/headers/condition_variable/ types_std_c++0x.cc: New. * testsuite/30_threads/headers/condition_variable/std_c++0x_neg.cc: New. * testsuite/30_threads/once_flag: New. * testsuite/30_threads/unique_lock: New. * testsuite/30_threads/unique_lock/requirements: New. * testsuite/30_threads/unique_lock/requirements/typedefs.cc: New. * testsuite/30_threads/unique_lock/requirements/ explicit_instantiation.cc: New. * testsuite/17_intro/headers/c++200x/all.cc: Add new includes. From-SVN: r135007
2008-05-06 23:11:47 +02:00
template<typename _Lock, typename _Clock,
typename _Duration, typename _Predicate>
bool
wait_until(_Lock& __lock,
const chrono::time_point<_Clock, _Duration>& __atime,
_Predicate __p)
{
while (!__p())
if (wait_until(__lock, __atime) == cv_status::timeout)
return __p();
return true;
}
template<typename _Lock, typename _Rep, typename _Period>
cv_status
wait_for(_Lock& __lock, const chrono::duration<_Rep, _Period>& __rtime)
{ return wait_until(__lock, __clock_t::now() + __rtime); }
template<typename _Lock, typename _Rep,
typename _Period, typename _Predicate>
bool
wait_for(_Lock& __lock,
const chrono::duration<_Rep, _Period>& __rtime, _Predicate __p)
{ return wait_until(__lock, __clock_t::now() + __rtime, std::move(__p)); }
condition_variable: New. 2008-05-06 Benjamin Kosnik <bkoz@redhat.com> * include/std/condition_variable: New. * include/std/mutex: New. * src/condition_variable.cc: New. * src/mutex.cc: New. * include/bits/functexcept.h: Add __throw_system_error varients. * src/functexcept.cc: Same. * config/abi/pre/gnu.ver: Add exports. * doc/xml/manual/using.xml: Add new includes. * doc/doxygen/user.cfg.in: Doxygen support. * doc/doxygen/doxygroups.cc: Same. * include/Makefile.am: Add mutex, condition_variable. * include/Makefile.in: Regenerated. * src/Makefile.am: Add mutex.cc, condition_variable.cc. * src/Makefile.in: Regenerated. * testsuite/30_threads: New. * testsuite/30_threads/lock_error: New. * testsuite/30_threads/mutex: New. * testsuite/30_threads/mutex/dest: New. * testsuite/30_threads/mutex/dest/destructor_locked.cc: New. * testsuite/30_threads/mutex/native_handle: New. * testsuite/30_threads/mutex/native_handle/1.cc: New. * testsuite/30_threads/mutex/cons: New. * testsuite/30_threads/mutex/cons/assign_neg.cc: New. * testsuite/30_threads/mutex/cons/1.cc: New. * testsuite/30_threads/mutex/cons/copy_neg.cc: New. * testsuite/30_threads/mutex/requirements: New. * testsuite/30_threads/mutex/requirements/typedefs.cc: New. * testsuite/30_threads/mutex/try_lock: New. * testsuite/30_threads/mutex/try_lock/1.cc: New. * testsuite/30_threads/mutex/try_lock/2.cc: New. * testsuite/30_threads/mutex/lock: New. * testsuite/30_threads/mutex/lock/1.cc: New. * testsuite/30_threads/mutex/unlock: New. * testsuite/30_threads/mutex/unlock/1.cc: New. * testsuite/30_threads/recursive_mutex: New. * testsuite/30_threads/recursive_mutex/dest: New. * testsuite/30_threads/recursive_mutex/dest/destructor_locked.cc: New. * testsuite/30_threads/recursive_mutex/native_handle: New. * testsuite/30_threads/recursive_mutex/native_handle/1.cc: New. * testsuite/30_threads/recursive_mutex/cons: New. * testsuite/30_threads/recursive_mutex/cons/assign_neg.cc: New. * testsuite/30_threads/recursive_mutex/cons/1.cc: New. * testsuite/30_threads/recursive_mutex/cons/copy_neg.cc: New. * testsuite/30_threads/recursive_mutex/requirements: New. * testsuite/30_threads/recursive_mutex/requirements/typedefs.cc: New. * testsuite/30_threads/lock_guard: New. * testsuite/30_threads/lock_guard/requirements: New. * testsuite/30_threads/lock_guard/requirements/typedefs.cc: New. * testsuite/30_threads/lock_guard/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/headers: New. * testsuite/30_threads/headers/mutex: New. * testsuite/30_threads/headers/mutex/types_std_c++0x.cc: New. * testsuite/30_threads/headers/mutex/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/condition_variable: New. * testsuite/30_threads/headers/condition_variable/ types_std_c++0x.cc: New. * testsuite/30_threads/headers/condition_variable/std_c++0x_neg.cc: New. * testsuite/30_threads/once_flag: New. * testsuite/30_threads/unique_lock: New. * testsuite/30_threads/unique_lock/requirements: New. * testsuite/30_threads/unique_lock/requirements/typedefs.cc: New. * testsuite/30_threads/unique_lock/requirements/ explicit_instantiation.cc: New. * testsuite/17_intro/headers/c++200x/all.cc: Add new includes. From-SVN: r135007
2008-05-06 23:11:47 +02:00
};
user.cfg.in: Tweaks. 2009-02-20 Benjamin Kosnik <bkoz@redhat.com> * doc/doxygen/user.cfg.in: Tweaks. * doc/doxygen/doxygroups.cc: Prefer markup that can be elsewhere, be elsewhere. * include/tr1_impl/unordered_map: Just use most specialized container module. * include/tr1_impl/unordered_set: Same. * include/tr1_impl/array: Same. * include/bits/stl_list.h: Same. * include/bits/stl_map.h: Same. * include/bits/stl_queue.h: Same. * include/bits/stl_set.h: Same. * include/bits/stl_stack.h: Same. * include/bits/forward_list.h: Same. * include/bits/basic_string.h: Same. * include/bits/stl_multimap.h: Same. * include/bits/stl_vector.h: Same. * include/bits/stl_deque.h: Same. * include/bits/stl_multiset.h: Same. * include/bits/stl_bvector.h: Same. * include/backward/binders.h: Change binder module to binders. * include/std/complex: Add complex_numers module. * include/tr1_impl/complex: Same. * include/std/valarray: Add numeric_arrays module. * include/bits/gslice_array.h: Same. * include/bits/gslice.h: Same. * include/bits/mask_array.h: Same. * include/bits/slice_array.h: Same. * include/bits/indirect_array.h: Same. * include/bits/allocator.h: Add allocators module. * include/ext/throw_allocator.h * include/ext/pool_allocator.h * include/ext/bitmap_allocator.h * include/ext/new_allocator.h * include/ext/malloc_allocator.h * include/ext/array_allocator.h * include/ext/mt_allocator.h * include/ext/debug_allocator.h * include/ext/extptr_allocator.h * include/tr1_impl/functional: Move namespace markup here. * include/tr1_impl/regex: Same. * include/tr1_impl/type_traits: Add metaprogramming module. * include/std/type_traits: Same. * include/std/memory: Add memory module. * include/std/ratio: Add ratio module. * include/std/chrono: Move namespace markup here, add time module. * include/std/thread: Move namespace markup here, add concurrency module. * include/std/mutex: Use concurrency module. * include/std/condition_variable: Same. * include/bits/ios_base.h: Refine io module. * include/bits/basic_ios.h: Same. * include/std/fstream: Same. * include/std/istream: Same. * include/std/ostream: Same. * include/std/sstream: Same. * include/ext/vstring.h: Correct parameter markup. * include/bits/shared_ptr.h: Add pointer_abstractions module. * include/bits/unique_ptr.h: Same. * include/bits/algorithmfwd.h: Add mutating_algorithms, non_mutating_algorithms, sorting_algorithms. Adjust nesting. * include/bits/stl_heap.h: Add markup for new groupings. * include/bits/stl_algobase.h: Same. * include/bits/stl_algo.h: Same. * include/c_compatibility/stdatomic.h: Add atomics module. * include/c_global/cstdatomic: Same. * libsupc++/exception: Add exceptions module. * libsupc++/typeinfo: Same. * libsupc++/new: Same. * libsupc++/exception_ptr.h: Same. * include/std/system_error: Same. * include/std/stdexcept: Same. * libsupc++/cxxabi.h: Move doxygroups.cc markup here. * libsupc++/cxxabi-forced.h: Same. * testsuite/27_io/ios_base/cons/assign_neg.cc: Fix up line numbers. * testsuite/27_io/ios_base/cons/copy_neg.cc: Same. * testsuite/30_threads/condition_variable_any/cons/assign_neg.cc: Same. * 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/29_atomics/atomic/cons/assign_neg.cc: Same. * testsuite/29_atomics/atomic/cons/copy_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/insert_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/insert_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/insert_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/20_util/duration/cons/1_neg.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg1.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg2.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg3.cc: Same. * testsuite/20_util/unique_ptr/modifiers/reset_neg.cc: Same. * testsuite/20_util/unique_ptr/assign/assign.cc: Same. * testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Same. * testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc: Same. * testsuite/20_util/ratio/cons/cons_overflow.cc: Same. * testsuite/20_util/ratio/operations/ops_overflow.cc: Same. From-SVN: r144343
2009-02-21 01:45:21 +01:00
// @} group condition_variables
PR libstdc++/36104 part four 2011-01-30 Benjamin Kosnik <bkoz@redhat.com> PR libstdc++/36104 part four * include/bits/c++config (_GLIBCXX_STD): Remove. (_GLIBCXX_STD_D, _GLIBCXX_PR): Now _GLIBCXX_STD_C. (_GLIBCXX_P): Now _GLIBCXX_STD_A. (_GLIBCXX_NAMESPACE_DEBUG, _GLIBCXX_NAMESPACE_PARALLEL, _GLIBCXX_NAMESPACE_PROFILE, _GLIBCXX_NAMESPACE_VERSION): Remove. (_GLIBCXX_INLINE_DEBUG, _GLIBCXX_INLINE_PARALLEL, _GLIBCXX_INLINE_PROFILE): Remove. (_GLIBCXX_BEGIN_NAMESPACE(X)): Remove. (_GLIBCXX_END_NAMESPACE): Remove. (_GLIBCXX_BEGIN_NESTED_NAMESPACE(X, Y)): Remove. (_GLIBCXX_END_NESTED_NAMESPACE): Remove. (_GLIBCXX_BEGIN_NAMESPACE_ALGO): Add. (_GLIBCXX_END_NAMESPACE_ALGO): Add. (_GLIBCXX_BEGIN_NAMESPACE_CONTAINER): Add. (_GLIBCXX_END_NAMESPACE_CONTAINER): Add. (_GLIBCXX_BEGIN_NAMESPACE_VERSION): Add. (_GLIBCXX_END_NAMESPACE_VERSION): Add. (_GLIBCXX_BEGIN_LDBL_NAMESPACE): To _GLIBCXX_BEGIN_NAMESPACE_LDBL. (_GLIBCXX_END_LDBL_NAMESPACE): To _GLIBCXX_END_NAMESPACE_LDBL. (_GLIBCXX_VISIBILITY_ATTR): Revert to _GLIBCXX_VISIBILITY. * include/*: Use new macros for namespace scope. * config/*: Same. * src/*: Same. * src/Makefile.am (sources): Remove debug_list.cc, add compatibility-debug_list-2.cc. (parallel_sources): Remove parallel_list.cc, add compatibility-parallel_list-2.cc. (compatibility-parallel_list-2.[o,lo]): New rule. * src/Makefile.in: Regenerate. * src/debug_list.cc: Remove. * src/parallel_list.cc: Remove. * src/compatibility-list-2.cc: New. * src/compatibility-debug_list-2.cc: New. * src/compatibility-parallel_list-2.cc: New. * doc/doxygen/user.cfg.in: Adjust macros. * testsuite/20_util/auto_ptr/assign_neg.cc: Adjust line numbers, macros. * testsuite/20_util/declval/requirements/1_neg.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg1.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg2.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg3.cc: Same. * testsuite/20_util/forward/c_neg.cc: Same. * testsuite/20_util/forward/f_neg.cc: Same. * testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Same. * testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc: Same. * testsuite/20_util/ratio/cons/cons_overflow_neg.cc: Same. * testsuite/20_util/ratio/operations/ops_overflow_neg.cc: Same. * testsuite/20_util/shared_ptr/cons/43820_neg.cc: Same. * testsuite/20_util/weak_ptr/comparison/cmp_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/insert_neg.cc: Same. * testsuite/23_containers/forward_list/capacity/1.cc: Same. * testsuite/23_containers/forward_list/requirements/dr438/ assign_neg.cc: Same. * testsuite/23_containers/forward_list/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/forward_list/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/forward_list/requirements/dr438/ insert_neg.cc: Same. * testsuite/23_containers/list/capacity/29134.cc: Same. * testsuite/23_containers/list/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/insert_neg.cc: Same. * testsuite/23_containers/vector/bool/capacity/29134.cc: Same. * testsuite/23_containers/vector/bool/modifiers/insert/31370.cc: Same. * testsuite/23_containers/vector/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/insert_neg.cc: Same. * testsuite/25_algorithms/sort/35588.cc: Same. * testsuite/27_io/ios_base/cons/assign_neg.cc: Same. * testsuite/27_io/ios_base/cons/copy_neg.cc: Same. * testsuite/ext/profile/mutex_extensions_neg.cc: Same. * testsuite/ext/profile/profiler_algos.cc: Same. * testsuite/ext/type_traits/add_unsigned_floating_neg.cc: Same. * testsuite/ext/type_traits/add_unsigned_integer_neg.cc: Same. * testsuite/ext/type_traits/remove_unsigned_floating_neg.cc: Same. * testsuite/ext/type_traits/remove_unsigned_integer_neg.cc: Same. * testsuite/tr1/2_general_utilities/shared_ptr/cons/43820_neg.cc: Same. From-SVN: r169421
2011-01-30 23:39:36 +01:00
_GLIBCXX_END_NAMESPACE_VERSION
} // namespace
condition_variable: New. 2008-05-06 Benjamin Kosnik <bkoz@redhat.com> * include/std/condition_variable: New. * include/std/mutex: New. * src/condition_variable.cc: New. * src/mutex.cc: New. * include/bits/functexcept.h: Add __throw_system_error varients. * src/functexcept.cc: Same. * config/abi/pre/gnu.ver: Add exports. * doc/xml/manual/using.xml: Add new includes. * doc/doxygen/user.cfg.in: Doxygen support. * doc/doxygen/doxygroups.cc: Same. * include/Makefile.am: Add mutex, condition_variable. * include/Makefile.in: Regenerated. * src/Makefile.am: Add mutex.cc, condition_variable.cc. * src/Makefile.in: Regenerated. * testsuite/30_threads: New. * testsuite/30_threads/lock_error: New. * testsuite/30_threads/mutex: New. * testsuite/30_threads/mutex/dest: New. * testsuite/30_threads/mutex/dest/destructor_locked.cc: New. * testsuite/30_threads/mutex/native_handle: New. * testsuite/30_threads/mutex/native_handle/1.cc: New. * testsuite/30_threads/mutex/cons: New. * testsuite/30_threads/mutex/cons/assign_neg.cc: New. * testsuite/30_threads/mutex/cons/1.cc: New. * testsuite/30_threads/mutex/cons/copy_neg.cc: New. * testsuite/30_threads/mutex/requirements: New. * testsuite/30_threads/mutex/requirements/typedefs.cc: New. * testsuite/30_threads/mutex/try_lock: New. * testsuite/30_threads/mutex/try_lock/1.cc: New. * testsuite/30_threads/mutex/try_lock/2.cc: New. * testsuite/30_threads/mutex/lock: New. * testsuite/30_threads/mutex/lock/1.cc: New. * testsuite/30_threads/mutex/unlock: New. * testsuite/30_threads/mutex/unlock/1.cc: New. * testsuite/30_threads/recursive_mutex: New. * testsuite/30_threads/recursive_mutex/dest: New. * testsuite/30_threads/recursive_mutex/dest/destructor_locked.cc: New. * testsuite/30_threads/recursive_mutex/native_handle: New. * testsuite/30_threads/recursive_mutex/native_handle/1.cc: New. * testsuite/30_threads/recursive_mutex/cons: New. * testsuite/30_threads/recursive_mutex/cons/assign_neg.cc: New. * testsuite/30_threads/recursive_mutex/cons/1.cc: New. * testsuite/30_threads/recursive_mutex/cons/copy_neg.cc: New. * testsuite/30_threads/recursive_mutex/requirements: New. * testsuite/30_threads/recursive_mutex/requirements/typedefs.cc: New. * testsuite/30_threads/lock_guard: New. * testsuite/30_threads/lock_guard/requirements: New. * testsuite/30_threads/lock_guard/requirements/typedefs.cc: New. * testsuite/30_threads/lock_guard/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/headers: New. * testsuite/30_threads/headers/mutex: New. * testsuite/30_threads/headers/mutex/types_std_c++0x.cc: New. * testsuite/30_threads/headers/mutex/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/condition_variable: New. * testsuite/30_threads/headers/condition_variable/ types_std_c++0x.cc: New. * testsuite/30_threads/headers/condition_variable/std_c++0x_neg.cc: New. * testsuite/30_threads/once_flag: New. * testsuite/30_threads/unique_lock: New. * testsuite/30_threads/unique_lock/requirements: New. * testsuite/30_threads/unique_lock/requirements/typedefs.cc: New. * testsuite/30_threads/unique_lock/requirements/ explicit_instantiation.cc: New. * testsuite/17_intro/headers/c++200x/all.cc: Add new includes. From-SVN: r135007
2008-05-06 23:11:47 +02:00
condition_variable: Use new deleted ctors. 2008-09-03 Chris Fairles <chris.fairles@gmail.com> * include/std/condition_variable: Use new deleted ctors. * include/std/mutex: Likewise plus implement timed_mutex, recursive_timed_mutex and call_once. * src/condition_variable.cc: Implement wait(). Use gthread types. Remove _GTHREADS_HAS_COND checks in favor of global _GLIBCXX_HAS_GTHREADS. * src/mutex.cc (call_once): Implementation using TLS with mutex fallback. * config/abi/pre/gnu.ver: Add exported symbols. * testsuite/lib/libstdc++.exp (check_v3_target_gthreads): New. * testsuite/lib/dg-options.exp (dg-require-gthreads): Likewise. * testsuite/30_threads/lock_guard/requirements/typedefs.cc: Use dg-require-gthreads and dg-require-cstdint. * testsuite/30_threads/lock_guard/requirements/ explicit_instantiation.cc: Likewise. * testsuite/30_threads/mutex/dest/destructor_locked.cc: Likewise. * testsuite/30_threads/mutex/native_handle/1.cc: Likewise. * testsuite/30_threads/mutex/cons/1.cc: Likewise. * testsuite/30_threads/mutex/requirements/typedefs.cc: Likewise. * testsuite/30_threads/mutex/try_lock/1.cc: Likewise. * testsuite/30_threads/mutex/try_lock/2.cc: Likewise. * testsuite/30_threads/mutex/lock/1.cc: Likewise. * testsuite/30_threads/mutex/unlock/1.cc: Likewise. * testsuite/30_threads/recursive_mutex/dest/destructor_locked.cc: Likewise. * testsuite/30_threads/recursive_mutex/native_handle/1.cc: Likewise. * testsuite/30_threads/recursive_mutex/cons/1.cc: Likewise. * testsuite/30_threads/recursive_mutex/requirements/typedefs.cc: Likewise. * testsuite/30_threads/recursive_mutex/try_lock/1.cc: Likewise. * testsuite/30_threads/recursive_mutex/try_lock/2.cc: Likewise. * testsuite/30_threads/recursive_mutex/lock/1.cc: Likewise. * testsuite/30_threads/recursive_mutex/unlock/1.cc: Likewise. * testsuite/30_threads/unique_lock/requirements/ explicit_instantiation.cc: Likewise. * testsuite/30_threads/unique_lock/requirements/typedefs.cc: Likewise. * testsuite/30_threads/mutex/cons/assign_neg.cc: Also adjust dg-error lines for deleted members. * testsuite/30_threads/mutex/cons/copy_neg.cc: Likewise. * testsuite/30_threads/recursive_mutex/cons/assign_neg.cc: Likewise. * testsuite/30_threads/recursive_mutex/cons/copy_neg.cc: Likewise. * testsuite/30_threads/call_once/once_flag.cc: New. * testsuite/30_threads/call_once/call_once1.cc: Likewise. * testsuite/30_threads/condition_variable/cons/1.cc: Likewise. * testsuite/30_threads/condition_variable/cons/copy_neg.cc: Likewise * testsuite/30_threads/condition_variable/cons/assign_neg.cc: Likewise. * testsuite/30_threads/condition_variable_any/cons/1.cc: Likewise. * testsuite/30_threads/condition_variable_any/cons/copy_neg.cc: Likewise. * testsuite/30_threads/condition_variable_any/cons/assign_neg.cc: Likewise. * testsuite/30_threads/timed_mutex/dest/destructor_locked.cc: Likewise. * testsuite/30_threads/timed_mutex/native_handle/1.cc: Likewise. * testsuite/30_threads/timed_mutex/try_lock_until/1.cc: Likewise. * testsuite/30_threads/timed_mutex/try_lock_until/2.cc: Likewise. * testsuite/30_threads/timed_mutex/cons/assign_neg.cc: Likewise. * testsuite/30_threads/timed_mutex/cons/1.cc: Likewise. * testsuite/30_threads/timed_mutex/cons/copy_neg.cc: Likewise. * testsuite/30_threads/timed_mutex/requirements/typedefs.cc: Likewise. * testsuite/30_threads/timed_mutex/try_lock/1.cc: Likewise. * testsuite/30_threads/timed_mutex/try_lock/2.cc: Likewise. * testsuite/30_threads/timed_mutex/lock/1.cc: Likewise. * testsuite/30_threads/timed_mutex/unlock/1.cc: Likewise. * testsuite/30_threads/timed_mutex/try_lock_for/1.cc: Likewise. * testsuite/30_threads/timed_mutex/try_lock_for/2.cc: Likewise. * testsuite/30_threads/timed_mutex/try_lock_for/3.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/dest/destructor_locked.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/try_lock_until/1.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/try_lock_until/2.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/native_handle/1.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/cons: Likewise. * testsuite/30_threads/recursive_timed_mutex/cons/assign_neg.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/cons/1.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/cons/copy_neg.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/requirements/typedefs.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/try_lock/1.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/try_lock/2.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/lock/1.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/lock/2.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/unlock/1.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/try_lock_for/1.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/try_lock_for/2.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/try_lock_for/3.cc: Likewise. * testsuite/30_threads/unique_lock/modifiers/1.cc: Likewise. * testsuite/30_threads/unique_lock/modifiers/2.cc: Likewise. * testsuite/30_threads/unique_lock/cons/1.cc: Likewise. * testsuite/30_threads/unique_lock/cons/2.cc: Likewise. * testsuite/30_threads/unique_lock/cons/3.cc: Likewise. * testsuite/30_threads/unique_lock/cons/4.cc: Likewise. * testsuite/30_threads/unique_lock/cons/5.cc: Likewise. * testsuite/30_threads/unique_lock/cons/6.cc: Likewise. * testsuite/30_threads/unique_lock/locking/1.cc: Likewise. * testsuite/30_threads/unique_lock/locking/2.cc: Likewise. * testsuite/30_threads/unique_lock/locking/3.cc: Likewise. * testsuite/30_threads/unique_lock/locking/4.cc: Likewise. From-SVN: r139943
2008-09-03 19:46:09 +02:00
#endif // _GLIBCXX_HAS_GTHREADS && _GLIBCXX_USE_C99_STDINT_TR1
#endif // C++11
#endif // _GLIBCXX_CONDITION_VARIABLE