Age | Commit message (Collapse) | Author | Files | Lines |
|
|
|
The incorrect errc constant here looks like a copy&paste error.
libstdc++-v3/ChangeLog:
PR libstdc++/112089
* include/std/shared_mutex (shared_lock::unlock): Change errc
constant to operation_not_permitted.
* testsuite/30_threads/shared_lock/locking/112089.cc: New test.
|
|
libstdc++-v3/ChangeLog:
* libsupc++/typeinfo: Switch to bits/version.h for
__cpp_lib_constexpr_typeinfo.
* libsupc++/new: Switch to bits/version.h for
__cpp_lib_{launder,hardware_interference_size,destroying_delete}.
(launder): Guard behind __cpp_lib_launder.
(hardware_destructive_interference_size)
(hardware_constructive_interference_size): Guard behind
__cpp_lib_hardware_interference_size.
* libsupc++/exception: Switch to bits/version.h for
__cpp_lib_uncaught_exceptions.
(uncaught_exceptions): Guard behind __cpp_lib_uncaught_exceptions.
* libsupc++/compare: Switch to bits/version.h for
__cpp_lib_three_way_comparison.
(three_way_comparable, three_way_comparable_with)
(compare_three_way, weak_order, strong_order, partial_order):
Guard behind __cpp_lib_three_way_comparison >= 201907L.
* include/std/chrono: Drop __cpp_lib_chrono definition.
* include/std/vector: Switch to bits/version.h for
__cpp_lib_erase_if.
(erase, erase_if): Guard behind __cpp_lib_erase_if.
* include/std/variant: Switch to bits/version.h for
__cpp_lib_variant. Guard whole header behind that FTM.
* include/std/utility: Switch to bits/version.h for
__cpp_lib_{exchange_function,constexpr_algorithms,as_const},
__cpp_lib_{integer_comparison_functions,to_underlying}, and
__cpp_lib_unreachable.
(exchange): Guard behind __cpp_lib_exchange_function.
(cmp_equal, cmp_not_equal, cmp_less, cmp_greater, cmp_less_equal)
(cmp_greater_equal, in_range): Guard behind
__cpp_lib_integer_comparison_functions.
(to_underlying): Guard behind __cpp_lib_to_underlying.
(unreachable): Guard behind __cpp_lib_unreachable.
* include/std/type_traits: Switch to bits/version.h for
__cpp_lib_is_{null_pointer,final,nothrow_convertible,aggregate},
__cpp_lib_is_{constant_evaluated,invocable,layout_compatible},
__cpp_lib_is_{pointer_interconvertible,scoped_enum,swappable},
__cpp_lib_{logical_traits,reference_from_temporary,remove_cvref},
__cpp_lib_{result_of_sfinae,transformation_trait_aliases},
__cpp_lib_{type_identity,type_trait_variable_templates},
__cpp_lib_{unwrap_ref,void_t,integral_constant_callable},
__cpp_lib_{bool_constant,bounded_array_traits}, and
__cpp_lib_has_unique_object_representations.
(integral_constant::operator()): Guard behind
__cpp_lib_integral_constant_callable.
(bool_constant): Guard behind __cpp_lib_bool_constant.
(conjunction, disjunction, negation, conjunction_v, disjunction_v)
(negation_v): Guard behind __cpp_lib_logical_traits.
(is_null_pointer): Guard behind __cpp_lib_is_null_pointer.
(is_final): Guard behind __cpp_lib_is_final.
(is_nothrow_convertible, is_nothrow_convertible_v): Guard behind
__cpp_lib_is_nothrow_convertible.
(remove_const_t, remove_volatile_t, remove_cv_t)
(add_const_t, add_volatile_t, add_cv_t): Guard behind
__cpp_lib_transformation_trait_aliases.
(void_t): Guard behind __cpp_lib_void_t.
(is_swappable_with_v, is_nothrow_swappable_with_v)
(is_swappable_with, is_nothrow_swappable_with): Guard behind
__cpp_lib_is_swappable.
(is_nothrow_invocable_r, is_invocable_r, invoke_result)
(is_invocable, invoke_result_t): Guard behind
__cpp_lib_is_invocable.
(alignment_of_v, extent_v, has_virtual_destructor_v)
(is_abstract_v, is_arithmetic_v, is_array_v)
(is_assignable_v, is_base_of_v, is_class_v, is_compound_v)
(is_constructible_v, is_const_v, is_convertible_v)
(is_copy_assignable_v, is_copy_constructible_v)
(is_default_constructible_v, is_destructible_v)
(is_empty_v, is_enum_v, is_final_v, is_floating_point_v)
(is_function_v, is_fundamental_v, is_integral_v)
(is_invocable_r_v, is_invocable_v, is_literal_type_v)
(is_lvalue_reference_v, is_member_function_pointer_v)
(is_member_object_pointer_v, is_member_pointer_v)
(is_move_assignable_v, is_move_constructible_v)
(is_nothrow_assignable_v, is_nothrow_constructible_v)
(is_nothrow_copy_assignable_v, is_nothrow_copy_constructible_v)
(is_nothrow_default_constructible_v, is_nothrow_destructible_v)
(is_nothrow_invocable_r_v, is_nothrow_invocable_v)
(is_nothrow_move_assignable_v, is_nothrow_move_constructible_v)
(is_null_pointer_v, is_object_v, is_pod_v, is_pointer_v)
(is_polymorphic_v, is_reference_v, is_rvalue_reference_v)
(is_same_v, is_scalar_v, is_signed_v, is_standard_layout_v)
(is_trivially_assignable_v, is_trivially_constructible_v)
(is_trivially_copyable_v, is_trivially_copy_assignable_v)
(is_trivially_copy_constructible_v)
(is_trivially_default_constructible_v)
(is_trivially_destructible_v, is_trivially_move_assignable_v)
(is_trivially_move_constructible_v, is_trivial_v, is_union_v)
(is_unsigned_v, is_void_v, is_volatile_v, rank_v, as variadic):
Guard behind __cpp_lib_type_trait_variable_templates.
(has_unique_object_representations)
(has_unique_object_representations_v): Guard behind
__cpp_lib_has_unique_object_representation.
(is_aggregate): Guard behind __cpp_lib_is_aggregate.
(remove_cvref, remove_cvref_t): Guard behind
__cpp_lib_remove_cvref.
(type_identity, type_identity_t): Guard behind
__cpp_lib_type_identity.
(unwrap_reference, unwrap_reference_t, unwrap_ref_decay)
(unwrap_ref_decay_t): Guard behind __cpp_lib_unwrap_ref.
(is_bounded_array_v, is_unbounded_array_v, is_bounded_array)
(is_unbounded_array): Guard behind __cpp_lib_bounded_array_traits.
(is_scoped_enum, is_scoped_enum_v): Guard behind
__cpp_lib_is_scoped_enum.
(reference_constructs_from_temporary)
(reference_constructs_from_temporary_v): Guard behind
__cpp_lib_reference_from_temporary.
* include/std/tuple: Switch to bits/version.h for
__cpp_lib_{constexpr_tuple,tuple_by_type,apply_make_from_tuple}.
(get<T>): Guard behind __cpp_lib_tuple_by_type.
(apply): Guard behind __cpp_lib_apply.
(make_from_tuple): Guard behind __cpp_lib_make_from_tuple.
* include/std/syncstream: Switch to bits/version.h for
__cpp_lib_syncbuf. Guard header behind that FTM.
* include/std/string_view: Switch to bits/version.h for
__cpp_lib_{string_{view,contains},constexpr_string_view} and
__cpp_lib_starts_ends_with.
(basic_string_view::starts_with, basic_string_view::ends_with):
Guard behind __cpp_lib_starts_ends_with.
[C++23 && _GLIBCXX_HOSTED && !defined(__cpp_lib_string_contains)]:
Assert as impossible ithout a bug in C++23.
* include/std/string: Switch to bits/version.h for
__cpp_lib_erase_if.
(erase, erase_if): Guard behind __cpp_lib_erase_if.
* include/std/thread: Switch to bits/version.h for
__cpp_lib_jthread.
* include/std/stop_token: Switch to bits/version.h for
__cpp_lib_jthread.
* include/std/spanstream: Switch to bits/version.h for
__cpp_lib_spanstream. Guard header behind that FTM.
* include/std/span: Switch to bits/version.h for __cpp_lib_span.
Guard header behind that FTM.
* include/std/source_location: Switch to bits/version.h for
__cpp_lib_source_location. Guard header with that FTM.
* include/std/shared_mutex: Switch to bits/version.h for
__cpp_lib_shared{,_timed}_mutex.
(shared_mutex): Guard behind __cpp_lib_shared_mutex.
* include/std/semaphore: Switch to bits/version.h for
__cpp_lib_semaphore. Guard header behind that FTM.
* include/std/ranges: Switch to bits/version.h for
__cpp_lib_ranges_{zip,chunk{,_by},slide,join_with},
__cpp_lib_ranges_{repeat_stride,cartesian_product,as_rvalue},
and __cpp_lib_ranges_{as_const,enumerate,iota}.
(ranges::zip et al, ranges::chunk et al, ranges::slide et al)
(ranges::chunk_by et al, ranges::join_with et al)
(ranges::stride et al, ranges::cartesian_product et al)
(ranges::as_rvalue et al, ranges::as_const et al)
(ranges::enumerate et al): Guard behind appropriate FTM.
* include/std/optional: Switch to bits/version.h for
__cpp_lib_optional. Guard header behind that FTM.
* include/std/numeric: Switch to bits/version.h for
__cpp_lib_{gcd{,_lcm},lcm,constexpr_numeric,interpolate}
and __cpp_lib_parallel_algorithm.
(gcd, lcm): Guard behind __cpp_lib_gcd_lcm.
(midpoint): Guard behind __cpp_lib_interpolate.
* include/std/numbers: Switch to bits/version.h for
__cpp_lib_math_constants. Guard header behind that FTM.
* include/std/mutex: Switch to bits/version.h for
__cpp_lib_scoped_lock.
(scoped_Lock): Guard behind __cpp_lib_scoped_lock.
* include/std/memory_resource: Switch to bits/version.h for
__cpp_lib_{polymorphic_allocator,memory_resource}.
(synchronized_pool_resource): Guard behind
__cpp_lib_memory_resource >= 201603L.
(polymorphic_allocator): Guard behind
__cpp_lib_polymorphic_allocator.
* include/std/memory: Switch to bits/version.h for
__cpp_lib_{parallel_algorithm,atomic_value_initialization}.
* include/std/list: Switch to bits/version.h for
__cpp_lib_erase_if.
(erase, erase_if): Guard behind __cpp_lib_erase_if.
* include/std/latch: Switch to bits/version.h for __cpp_lib_latch.
Guard header behind that FTM.
* include/std/iterator: Switch to bits/version.h for
__cpp_lib_null_iterators.
* include/std/iomanip: Switch to bits/version.h for
__cpp_lib_quoted_string_io.
(quoted): Guard behind __cpp_lib_quoted_string_io.
* include/std/functional: Switch to bits/version.h for
__cpp_lib_{invoke{,_r},constexpr_functional,bind_front} and
__cpp_lib_{not_fn,booyer_moore_searcher}.
(invoke): Guard behind __cpp_lib_invoke.
(invoke_r): Guard behind __cpp_lib_invoke_r.
(bind_front): Guard behind __cpp_lib_bind_front.
(not_fn): Guard behind __cpp_lib_not_fn.
(boyer_moore_searcher, boyer_moore_horspool_searcher): Guard
definition behind __cpp_lib_boyer_moore_searcher.
* include/std/forward_list: Switch to bits/version.h for
__cpp_lib_erase_if.
(erase, erase_if): Guard behind __cpp_lib_erase_if.
* include/std/format: Switch to bits/version.h for
__cpp_lib_format. Guard header behind that FTM.
* include/std/filesystem: Switch to bits/version.h for
__cpp_lib_filesystem. Guard header behind that FTM.
* include/std/expected: Switch to bits/version.h for
__cpp_lib_expected. Guard header behind it.
* include/std/execution: Switch to bits/version.h for
__cpp_lib_{execution,parallel_algorithm}. Guard header behind
either.
* include/std/deque: Switch to bits/version.h for
__cpp_lib_erase_if.
(erase, erase_if): Guard behind __cpp_lib_erase_if.
* include/std/coroutine: Switch to bits/version.h for
__cpp_lib_coroutine. Guard header behind that FTM.
* include/std/concepts: Switch to bits/version.h for
__cpp_lib_concepts. Guard header behind that FTM.
* include/std/complex: Switch to bits/version.h for
__cpp_lib_{complex_udls,constexpr_complex}.
(operator""if, operator""i, operator""il): Guard behind
__cpp_lib_complex_udls.
* include/std/charconv: Swtich to bits/version.h for
__cpp_lib_{to_chars,constexpr_charconv}.
* include/std/bitset: Switch to bits/version.h for
__cpp_lib_constexpr_bitset.
* include/std/bit: Switch to bits/version.h for
__cpp_lib_{bit_cast,byteswap,bitops,int_pow2,endian}.
(bit_cast): Guard behind __cpp_lib_bit_cast.
(byteswap): Guard behind __cpp_lib_byteswap.
(rotl, rotr, countl_zero, countl_one, countr_zero, countr_one)
(popcount): Guard behind __cpp_lib_bitops.
(has_single_bit, bit_ceil, bit_floor, bit_width): Guard behind
__cpp_lib_int_pow2.
(endian): Guard behind __cpp_lib_endian.
* include/std/barrier: Switch to bits/version.h for
__cpp_lib_barrier. Guard header behind that FTM.
* include/std/atomic: Switch to bits/version.h for
__cpp_lib_atomic_{is_always_lock_free,float,ref}
and __cpp_lib_lock_free_type_aliases.
(*::is_always_lock_free): Guard behind
__cpp_lib_atomic_is_always_lock_free.
(atomic<float>): Guard behind __cpp_lib_atomic_float.
(atomic_ref): Guard behind __cpp_lib_atomic_ref.
(atomic_signed_lock_free, atomic_unsigned_lock_free): Guard behind
__cpp_lib_atomic_lock_free_type_aliases.
* include/std/array: Switch to bits/version.h for
__cpp_lib_to_array.
(to_array): Guard behind __cpp_lib_to_array.
* include/std/any: Switch to bits/version.h for __cpp_lib_any.
Guard header behind that FTM.
* include/std/algorithm: Switch to bits/version.h for
__cpp_lib_parallel_algorithm.
* include/c_global/cstddef: Switch to bits/version.h for
__cpp_lib_byte.
(byte): Guard behind __cpp_lib_byte.
* include/c_global/cmath: Switch to bits/version.h for
__cpp_lib_{hypot,interpolate}.
(hypot3): Guard behind __cpp_lib_hypot.
(lerp): Guard behind __cpp_lib_interpolate.
* include/c_compatibility/stdatomic.h: Switch to
bits/stl_version.h for __cpp_lib_atomic. Guard header behind that
FTM.
* include/bits/utility.h: Switch to bits/version.h for
__cpp_lib_{tuple_element_t,integer_sequence,ranges_zip}.
(tuple_element_t): Guard behind __cpp_lib_tuple_element_t.
(integer_sequence et al): Guard behind __cpp_lib_integer_sequence.
* include/bits/uses_allocator_args.h: Switch to bits/version.h for
__cpp_lib_make_obj_using_allocator. Guard header behind that FTM.
* include/bits/unordered_map.h: Switch to bits/version.h for
__cpp_lib_unordered_map_try_emplace.
(try_emplace): Guard behind __cpp_lib_unordered_map_try_emplace.
* include/bits/unique_ptr.h: Switch to bits/version.h for
__cpp_lib_{constexpr_memory,make_unique}.
(make_unique): Guard behind __cpp_lib_make_unique.
* include/bits/stl_vector.h: Switch to bits/version.h for
__cpp_lib_constexpr_vector.
* include/bits/stl_uninitialized.h: Switch to bits/version.h for
__cpp_lib_raw_memory_algorithms.
(uninitialized_default_construct)
(uninitialized_default_construct_n, uninitialized_move)
(uninitialized_move_n, uninitialized_value_construct)
(uninitialized_value_construct_n): Guard behind
__cpp_lib_raw_memory_algorithms.
* include/bits/stl_tree.h: Switch to bits/version.h for
__cpp_lib_generic_associative_lookup.
* include/bits/stl_stack.h: Switch to bits/version.h for
__cpp_lib_adaptor_iterator_pair_constructor.
(stack): Guard iterator-pair constructor behind
__cpp_lib_adaptor_iterator_pair_constructor.
* include/bits/stl_queue.h: Switch to bits/version.h for
__cpp_lib_adaptor_iterator_pair_constructor.
(queue): Guard iterator-pair constructor behind
__cpp_lib_adaptor_iterator_pair_constructor.
* include/bits/stl_pair.h: Switch to bits/version.h for
__cpp_lib_{concepts,tuples_by_type}.
(get): Guard type-getting overloads behind
__cpp_lib_tuples_by_type.
* include/bits/stl_map.h: Switch to bits/version.h for
__cpp_lib_map_try_emplace.
(map<>::try_emplace): Guard behind __cpp_lib_map_try_emplace.
* include/bits/stl_list.h: Switch to bits/version.h for
__cpp_lib_list_remove_return_type.
(__remove_return_type, _GLIBCXX_LIST_REMOVE_RETURN_TYPE_TAG)
[C++20]: guard behind __cpp_lib_list_remove_return_type instead.
* include/bits/stl_iterator.h: Switch to bits/version.h for
__cpp_lib_{constexpr_iterator,array_constexpr} and
__cpp_lib_{make_reverse_iterator,move_iterator_concept}.
(make_reverse_iterator): Guard behind
__cpp_lib_make_reverse_iterator.
(iterator_concept et al): Guard __cpp_lib_move_iterator_concept
changes behind that FTM.
* include/bits/stl_function.h: Switch to bits/version.h for
__cpp_lib_transparent_operators.
(equal_to, not_equal_to, greater, less, greater_equal)
(less_equal, bit_and, bit_or, bit_xor, bit_not, logical_and)
(logical_or, logical_not, plus, minus, multiplies, divides)
(modulus, negate): Guard '= void' fwdecls behind
__cpp_lib_transparent_operators.
(plus<void>, minus<void>, multiplies<void>, divides<void>)
(modulus<void>, negate<void>, logical_and<void>, logical_or<void>)
(logical_not<void>, bit_and<void>, bit_or<void>, bit_xor<void>)
(equal_to<void>, not_equal_to<void>, greater<void>, less<void>)
(greater_equal<void>, less_equal<void>, bit_not<void>)
(__has_is_transparent): Guard behind
__cpp_lib_transparent_operators.
* include/bits/stl_algobase.h: Switch to bits/version.h for
__cpp_lib_robust_nonmodifying_seq_ops.
(robust equal, mismatch): Guard behind
__cpp_lib_nonmember_container_access.
* include/bits/stl_algo.h: Swtich to bits/version.h for
__cpp_lib_{clamp,sample}.
(clamp): Guard behind __cpp_lib_clamp.
(sample): Guard behind __cpp_lib_sample.
* include/bits/specfun.h: Switch to bits/version.h for
__cpp_lib_math_special_functions and __STDCPP_MATH_SPEC_FUNCS__.
* include/bits/shared_ptr_base.h: Switch to bits/version.h for
__cpp_lib_{smart_ptr_for_overwrite,shared_ptr_arrays}.
(_Sp_overwrite_tag): Guard behind
__cpp_lib_smart_ptr_for_overwrite.
* include/bits/shared_ptr_atomic.h: Switch to bits/version.h for
__cpp_lib_atomic_shared_ptr.
* include/bits/shared_ptr.h: Switch to bits/version.h for
__cpp_lib_{enable_shared_from_this,shared_ptr_weak_type}.
(shared_ptr<T>::weak_type): Guard behind
__cpp_lib_shared_ptr_weak_type.
(enable_shared_from_this<T>::weak_from_this): Guard behind
__cpp_lib_enable_shared_from_this.
* include/bits/ranges_cmp.h: Switch to bits/version.h for
__cpp_lib_ranges.
* include/bits/ranges_algo.h: Switch to bits/version.h for
__cpp_lib_{shift,ranges_{contains,find_last,fold,iota}}.
* include/bits/range_access.h: Switch to bits/version.h for
__cpp_lib_nonmember_container_access
(size, empty, data): Guard behind
__cpp_lib_nonmember_container_access.
(ssize): Guard behind __cpp_lib_ssize.
* include/bits/ptr_traits.h: Switch to bits/version.h. for
__cpp_lib_{constexpr_memory,to_address}.
(to_address): Guard behind __cpp_lib_to_address.
* include/bits/node_handle.h: Switch to bits/version.h for
__cpp_lib_node_extract. Guard header behind that FTM.
* include/bits/move_only_function.h: Switch to bits/version.h for
__cpp_lib_move_only_function. Guard header behind that FTM.
* include/bits/move.h: Switch to bits/version.h for
__cpp_lib_addressof_constexpr.
* include/bits/ios_base.h: Switch to bits/version.h for
__cpp_lib_ios_noreplace.
(noreplace): Guard with __cpp_lib_ios_noreplace.
* include/bits/hashtable.h: Switch to bits/version.h for
__cpp_lib_generic_unordered_lookup.
(_M_equal_range_tr, _M_count_tr, _M_find_tr): Guard behind
__cpp_lib_generic_unordered_lookup.
* include/bits/forward_list.h: Switch to bits/version.h for
__cpp_lib_list_remove_return_type.
(__remove_return_type): Guard behind
__cpp_lib_list_remove_return_type.
* include/bits/erase_if.h: Switch to bits/version.h for
__cpp_lib_erase_if.
* include/bits/cow_string.h: Switch to bits/version.h for
__cpp_lib_constexpr_string.
* include/bits/chrono.h: Swtich to bits/version.h for
__cpp_lib_chrono{,_udls}.
(ceil): Guard behind __cpp_lib_chrono.
(operator""ns et al): Guard behind __cpp_lib_chrono_udls.
* include/bits/char_traits.h: Switch to bits/version.h for
__cpp_lib_constexpr_char_traits.
* include/bits/basic_string.h: Switch to bits/version.h for
__cpp_lib_{constexpr_string,string_{resize_and_overwrite,udls}}.
(resize_and_overwrite): Guard behind
__cpp_lib_string_resize_and_overwrite.
(operator""s): Guard behind __cpp_lib_string_udls.
* include/bits/atomic_wait.h: Switch to bits/version.h for
__cpp_lib_atomic_wait. Guard header behind that FTM.
* include/bits/atomic_base.h: Switch to bits/version.h for
__cpp_lib_atomic_value_initialization and
__cpp_lib_atomic_flag_test.
(atomic_flag::test): Guard behind __cpp_lib_atomic_flag_test,
rather than C++20.
* include/bits/allocator.h: Switch to bits/version.h for
__cpp_lib_incomplete_container_elements.
* include/bits/alloc_traits.h: Switch to using bits/version.h for
__cpp_lib_constexpr_dynamic_alloc and
__cpp_lib_allocator_traits_is_always_equal.
* include/bits/align.h: Switch to bits/version.h for defining
__cpp_lib_assume_aligned.
(assume_aligned): Guard with __cpp_lib_assume_aligned.
* include/bits/algorithmfwd.h: Switch to bits/version.h for
defining __cpp_lib_constexpr_algorithms.
* include/std/stacktrace: Switch to bits/version.h for
__cpp_lib_stacktrace. Guard header behind that FTM.
* testsuite/23_containers/array/tuple_interface/get_neg.cc:
Update line numbers.
|
|
|
|
The <condition_variable>, <mutex>, and <shared_mutex> headers use
std::errc constants, but don't use std::system_error itself. They only
use the __throw_system_error(int) function, which is defined in
<bits/functexcept.h>.
By including the header for the errc constants instead of the whole of
<system_error> we avoid depending on the whole std::string definition.
libstdc++-v3/ChangeLog:
* include/bits/std_mutex.h: Remove <system_error> include.
* include/std/condition_variable: Add <bits/error_constants.h>
include.
* include/std/mutex: Likewise.
* include/std/shared_mutex: Likewise.
|
|
libstdc++-v3/ChangeLog:
* include/bits/std_mutex.h (mutex): Add nodiscard attribute to
try_lock member function.
* include/bits/unique_lock.h (unique_lock): Likewise for
try_lock, try_lock_until, try_lock_for member functions, and
owns_lock and mutex member functions.
* include/std/mutex (recursive_mutex): Likewise for try_lock
member function.
(timed_mutex, recursive_timed_mutex, try_lock): Likewise for
try_lock, try_lock_until, try_lock_for member functions.
(try_lock): Likewise for non-member function.
* include/std/shared_mutex (shared_mutex): Likewise for try_lock
and try_lock_shared member functions.
(shared_timed_mutex): Likewise for try_lock, try_lock_for,
try_lock_shared, try_lock_shared_for, try_lock_until, and
try_lock_shared_until member functions.
(shared_lock): Likewise for try_lock, try_lock, try_lock_for,
try_lock_until, owns_lock, and mutex member functions.
* testsuite/30_threads/recursive_timed_mutex/try_lock_until/clock_neg.cc:
Cast discarded value expression to void.
* testsuite/30_threads/shared_lock/locking/3.cc: Likewise.
* testsuite/30_threads/shared_lock/locking/4.cc: Likewise.
* testsuite/30_threads/shared_lock/locking/clock_neg.cc:
Likewise.
* testsuite/30_threads/shared_timed_mutex/try_lock_until/clock_neg.cc:
Likewise.
* testsuite/30_threads/timed_mutex/try_lock_until/clock_neg.cc:
Likewise.
* testsuite/30_threads/try_lock/4.cc: Likewise.
* testsuite/30_threads/unique_lock/cons/60497.cc: Likewise.
* testsuite/30_threads/unique_lock/locking/3.cc: Likewise.
* testsuite/30_threads/unique_lock/locking/clock_neg.cc:
Likewise.
|
|
PR libstdc++/103626 - _GLIBCXX_HOSTED should respect -ffreestanding
Co-authored-by: Jonathan Wakely <jwakely@redhat.com>
libstdc++-v3/ChangeLog:
PR libstdc++/103626
* include/Makefile.am: Add new header.
* include/Makefile.in: Regenerate.
* include/bits/requires_hosted.h: New header.
* include/experimental/algorithm: Include
<bits/requires_hosted.h>.
* include/experimental/any: Likewise.
* include/experimental/array: Likewise.
* include/experimental/buffer: Likewise.
* include/experimental/chrono: Likewise.
* include/experimental/deque: Likewise.
* include/experimental/executor: Likewise.
* include/experimental/filesystem: Likewise.
* include/experimental/forward_list: Likewise.
* include/experimental/functional: Likewise.
* include/experimental/internet: Likewise.
* include/experimental/io_context: Likewise.
* include/experimental/iterator: Likewise.
* include/experimental/list: Likewise.
* include/experimental/map: Likewise.
* include/experimental/memory: Likewise.
* include/experimental/memory_resource: Likewise.
* include/experimental/net: Likewise.
* include/experimental/netfwd: Likewise.
* include/experimental/numeric: Likewise.
* include/experimental/optional: Likewise.
* include/experimental/propagate_const: Likewise.
* include/experimental/random: Likewise.
* include/experimental/ratio: Likewise.
* include/experimental/regex: Likewise.
* include/experimental/scope: Likewise.
* include/experimental/set: Likewise.
* include/experimental/simd: Likewise.
* include/experimental/socket: Likewise.
* include/experimental/source_location: Likewise.
* include/experimental/string: Likewise.
* include/experimental/string_view: Likewise.
* include/experimental/system_error: Likewise.
* include/experimental/timer: Likewise.
* include/experimental/tuple: Likewise.
* include/experimental/unordered_map: Likewise.
* include/experimental/unordered_set: Likewise.
* include/experimental/utility: Likewise.
* include/experimental/vector: Likewise.
* include/std/barrier: Likewise.
* include/std/chrono: Likewise.
* include/std/condition_variable: Likewise.
* include/std/deque: Likewise.
* include/std/execution: Likewise.
* include/std/filesystem: Likewise.
* include/std/forward_list: Likewise.
* include/std/fstream: Likewise.
* include/std/future: Likewise.
* include/std/iomanip: Likewise.
* include/std/ios: Likewise.
* include/std/iosfwd: Likewise.
* include/std/iostream: Likewise.
* include/std/istream: Likewise.
* include/std/latch: Likewise.
* include/std/list: Likewise.
* include/std/locale: Likewise.
* include/std/map: Likewise.
* include/std/memory_resource: Likewise.
* include/std/mutex: Likewise.
* include/std/ostream: Likewise.
* include/std/queue: Likewise.
* include/std/random: Likewise.
* include/std/regex: Likewise.
* include/std/semaphore: Likewise.
* include/std/set: Likewise.
* include/std/shared_mutex: Likewise.
* include/std/spanstream: Likewise.
* include/std/sstream: Likewise.
* include/std/stack: Likewise.
* include/std/stacktrace: Likewise.
* include/std/stop_token: Likewise.
* include/std/streambuf: Likewise.
* include/std/string: Likewise.
* include/std/syncstream: Likewise.
* include/std/system_error: Likewise.
* include/std/thread: Likewise.
* include/std/unordered_map: Likewise.
* include/std/unordered_set: Likewise.
* include/std/valarray: Likewise.
* include/std/vector: Likewise.
* include/tr1/array: Likewise.
* include/tr1/ccomplex: Likewise.
* include/tr1/cctype: Likewise.
* include/tr1/cfenv: Likewise.
* include/tr1/cfloat: Likewise.
* include/tr1/cinttypes: Likewise.
* include/tr1/climits: Likewise.
* include/tr1/cmath: Likewise.
* include/tr1/complex: Likewise.
* include/tr1/complex.h: Likewise.
* include/tr1/cstdarg: Likewise.
* include/tr1/cstdbool: Likewise.
* include/tr1/cstdint: Likewise.
* include/tr1/cstdio: Likewise.
* include/tr1/cstdlib: Likewise.
* include/tr1/ctgmath: Likewise.
* include/tr1/ctime: Likewise.
* include/tr1/ctype.h: Likewise.
* include/tr1/cwchar: Likewise.
* include/tr1/cwctype: Likewise.
* include/tr1/fenv.h: Likewise.
* include/tr1/float.h: Likewise.
* include/tr1/functional: Likewise.
* include/tr1/inttypes.h: Likewise.
* include/tr1/limits.h: Likewise.
* include/tr1/math.h: Likewise.
* include/tr1/memory: Likewise.
* include/tr1/random: Likewise.
* include/tr1/regex: Likewise.
* include/tr1/stdarg.h: Likewise.
* include/tr1/stdbool.h: Likewise.
* include/tr1/stdint.h: Likewise.
* include/tr1/stdio.h: Likewise.
* include/tr1/stdlib.h: Likewise.
* include/tr1/tgmath.h: Likewise.
* include/tr1/tuple: Likewise.
* include/tr1/type_traits: Likewise.
* include/tr1/unordered_map: Likewise.
* include/tr1/unordered_set: Likewise.
* include/tr1/utility: Likewise.
* include/tr1/wchar.h: Likewise.
* include/tr1/wctype.h: Likewise.
* include/c_global/cmath: Likewise.
* include/ext/algorithm: Include <bits/requires_hosted.h>.
* include/ext/bitmap_allocator.h: Likewise.
* include/ext/cmath: Likewise.
* include/ext/codecvt_specializations.h: Likewise.
* include/ext/debug_allocator.h: Likewise.
* include/ext/enc_filebuf.h: Likewise.
* include/ext/extptr_allocator.h: Likewise.
* include/ext/functional: Likewise.
* include/ext/malloc_allocator.h: Likewise.
* include/ext/memory: Likewise.
* include/ext/mt_allocator.h: Likewise.
* include/ext/new_allocator.h: Likewise.
* include/ext/numeric: Likewise.
* include/ext/pod_char_traits.h: Likewise.
* include/ext/pool_allocator.h: Likewise.
* include/ext/random: Likewise.
* include/ext/random.tcc: Likewise.
* include/ext/rb_tree: Likewise.
* include/ext/rc_string_base.h: Likewise.
* include/ext/rope: Likewise.
* include/ext/ropeimpl.h: Likewise.
* include/ext/slist: Likewise.
* include/ext/sso_string_base.h: Likewise.
* include/ext/stdio_filebuf.h: Likewise.
* include/ext/stdio_sync_filebuf.h: Likewise.
* include/ext/string_conversions.h: Likewise.
* include/ext/throw_allocator.h: Likewise.
* include/ext/vstring.h: Likewise.
* include/ext/vstring.tcc: Likewise.
* include/ext/vstring_fwd.h: Likewise.
* include/ext/vstring_util.h: Likewise.
* include/std/charconv: Likewise.
(__cpp_lib_to_chars): Do not define for freestanding.
* include/std/version: Adjust which macros get defined in
freestanding.
* include/ext/pointer.h [!_GLIBCXX_HOSTED]: Omit iostream
functionality from freestanding.
* include/std/algorithm [!_GLIBCXX_HOSTED]: Omit PSTL algos.
* include/std/memory [!_GLIBCXX_HOSTED]: Omit
<bits/stl_tempbuf.h> in freestanding
* include/bits/algorithmfwd.h [!_GLIBCXX_HOSTED]: Omit leftover
random_shuffle and stable_partition definition.
* include/bits/stl_algo.h [!_GLIBCXX_HOSTED]: Omit
random_shuffle and stable_partition from freestanding.
* include/bits/ranges_algo.h [!_GLIBCXX_HOSTED]: Omit
stable_partition from freestanding.
* include/bits/concept_check.h: Remove needless HOSTED check.
* include/std/iterator: Include <bits/ranges_base.h>.
* include/std/numeric (__cpp_lib_parallel_algorithms): Do not
define for freestanding.
* include/std/functional (__cpp_lib_boyer_moore_searcher):
Likewise.
* testsuite/lib/prune.exp: Match error for hosted-only libstdc++
tests.
|
|
|
|
This moves the "classic" contents of <chrono> to a new header, so that
<future>, <thread> etc. can get use durations and clocks without
calendar types, time zones, and chrono I/O.
libstdc++-v3/ChangeLog:
* include/Makefile.am: Add new header.
* include/Makefile.in: Regenerate.
* include/std/chrono (duration, time_point, system_clock)
(steady_clock, high_resolution_clock, chrono_literals, sys_time)
(file_clock, file_time): Move to ...
* include/bits/chrono.h: New file.
* include/bits/atomic_futex.h: Include new header instead of
<chrono>.
* include/bits/atomic_timed_wait.h: Likewise.
* include/bits/fs_fwd.h: Likewise.
* include/bits/semaphore_base.h: Likewise.
* include/bits/this_thread_sleep.h: Likewise.
* include/bits/unique_lock.h: Likewise.
* include/experimental/bits/fs_fwd.h: Likewise.
* include/experimental/chrono: Likewise.
* include/experimental/io_context: Likewise.
* include/experimental/netfwd: Likewise.
* include/experimental/timer: Likewise.
* include/std/condition_variable: Likewise.
* include/std/mutex: Likewise.
* include/std/shared_mutex: Likewise.
|
|
A change in Doxygen 1.8.16 means that "// @}" is no longer recognized by
Doxygen, so doesn't close a @{ group. A "///" comment needs to be used.
libstdc++-v3/ChangeLog:
* include/bits/atomic_base.h: Fix doxygen group close.
* include/bits/basic_ios.h: Likewise.
* include/bits/forward_list.h: Likewise.
* include/bits/fs_dir.h: Likewise.
* include/bits/fs_ops.h: Likewise.
* include/bits/fs_path.h: Likewise.
* include/bits/functional_hash.h: Likewise.
* include/bits/gslice.h: Likewise.
* include/bits/gslice_array.h: Likewise.
* include/bits/hashtable_policy.h: Likewise.
* include/bits/indirect_array.h: Likewise.
* include/bits/locale_classes.h: Likewise.
* include/bits/locale_facets.h: Likewise.
* include/bits/locale_facets_nonio.h: Likewise.
* include/bits/mask_array.h: Likewise.
* include/bits/refwrap.h: Likewise.
* include/bits/regex.h: Likewise.
* include/bits/regex_automaton.h: Likewise.
* include/bits/regex_compiler.h: Likewise.
* include/bits/regex_constants.h: Likewise.
* include/bits/regex_error.h: Likewise.
* include/bits/regex_executor.h: Likewise.
* include/bits/regex_scanner.h: Likewise.
* include/bits/shared_ptr.h: Likewise.
* include/bits/shared_ptr_atomic.h: Likewise.
* include/bits/shared_ptr_base.h: Likewise.
* include/bits/slice_array.h: Likewise.
* include/bits/specfun.h: Likewise.
* include/bits/std_function.h: Likewise.
* include/bits/std_mutex.h: Likewise.
* include/bits/stl_deque.h: Likewise.
* include/bits/stl_iterator.h: Likewise.
* include/bits/stl_iterator_base_types.h: Likewise.
* include/bits/stl_map.h: Likewise.
* include/bits/stl_multimap.h: Likewise.
* include/bits/stl_multiset.h: Likewise.
* include/bits/stl_numeric.h: Likewise.
* include/bits/stl_pair.h: Likewise.
* include/bits/stl_set.h: Likewise.
* include/bits/stl_uninitialized.h: Likewise.
* include/bits/stream_iterator.h: Likewise.
* include/bits/streambuf_iterator.h: Likewise.
* include/bits/unique_ptr.h: Likewise.
* include/bits/unordered_map.h: Likewise.
* include/bits/unordered_set.h: Likewise.
* include/decimal/decimal: Likewise.
* include/experimental/any: Likewise.
* include/experimental/array: Likewise.
* include/experimental/bits/fs_dir.h: Likewise.
* include/experimental/bits/fs_fwd.h: Likewise.
* include/experimental/bits/fs_ops.h: Likewise.
* include/experimental/bits/fs_path.h: Likewise.
* include/experimental/buffer: Likewise.
* include/experimental/internet: Likewise.
* include/experimental/optional: Likewise.
* include/experimental/propagate_const: Likewise.
* include/experimental/socket: Likewise.
* include/ext/pb_ds/assoc_container.hpp: Likewise.
* include/ext/pb_ds/detail/priority_queue_base_dispatch.hpp:
Likewise.
* include/ext/pb_ds/detail/tree_policy/node_metadata_selector.hpp: Likewise.
* include/ext/pb_ds/detail/trie_policy/node_metadata_selector.hpp: Likewise.
* include/ext/pb_ds/detail/types_traits.hpp: Likewise.
* include/ext/pb_ds/exception.hpp: Likewise.
* include/ext/pb_ds/priority_queue.hpp: Likewise.
* include/ext/pb_ds/tag_and_trait.hpp: Likewise.
* include/ext/random: Likewise.
* include/std/any: Likewise.
* include/std/atomic: Likewise.
* include/std/bitset: Likewise.
* include/std/chrono: Likewise.
* include/std/complex: Likewise.
* include/std/condition_variable: Likewise.
* include/std/fstream: Likewise.
* include/std/future: Likewise.
* include/std/iostream: Likewise.
* include/std/istream: Likewise.
* include/std/mutex: Likewise.
* include/std/numeric: Likewise.
* include/std/ostream: Likewise.
* include/std/ratio: Likewise.
* include/std/shared_mutex: Likewise.
* include/std/stdexcept: Likewise.
* include/std/streambuf: Likewise.
* include/std/system_error: Likewise.
* include/std/thread: Likewise.
* include/std/valarray: Likewise.
* include/std/variant: Likewise.
* include/tr1/cmath: Likewise.
* include/tr1/regex: Likewise.
* include/tr2/dynamic_bitset: Likewise.
* libsupc++/atomic_lockfree_defines.h: Likewise.
* libsupc++/exception: Likewise.
* libsupc++/exception.h: Likewise.
* libsupc++/exception_ptr.h: Likewise.
* libsupc++/nested_exception.h: Likewise.
libstdc++-v3/ChangeLog:
* include/tr1/regex:
|
|
|
|
The <condition_variable> header is not small, so <shared_mutex> should
not include it unless it actually needs std::condition_variable, which
is only the case when we don't have pthread_rwlock_t and the POSIX
Timers option.
The <shared_mutex> header would be even smaller if we had a header for
std::condition_variable (separate from std::condition_variable_any).
That's already planned for a future change.
And <memory_resource> would be even smaller if it was possible to get
std::shared_mutex without std::shared_timed_mutex (which depends on
<chrono>). For that to be effective, the synchronized_pool_resource
would have to create its own simpler version of std::shared_lock without
the timed waiting functions. I have no plans to do that.
libstdc++-v3/ChangeLog:
* include/std/shared_mutex: Only include <condition_variable>
when pthread_rwlock_t and POSIX timers are not available.
(__cpp_lib_shared_mutex, __cpp_lib_shared_timed_mutex): Change
value to be type 'long'.
* include/std/version (__cpp_lib_shared_mutex)
(__cpp_lib_shared_timed_mutex): Likewise.
|
|
For C++20 the wait_until members of mutexes and condition variables are
required to be ill-formed if given a clock that doesn't meet the
requirements for a clock type. To implement that requirement this patch
adds static assertions using the chrono::is_clock trait, and defines
that trait.
To avoid expensive checks for the common cases, the trait (and
associated variable template) are explicitly specialized for the
standard clock types.
This also moves the filesystem::__file_clock type from <filesystem> to
<chrono>, so that chrono::file_clock and chrono::file_time can be
defined in <chrono> as required.
* include/bits/fs_fwd.h (filesystem::__file_clock): Move to ...
* include/std/chrono (filesystem::__file_clock): Here.
(filesystem::__file_clock::from_sys, filesystem::__file_clock::to_sys):
Define public member functions for C++20.
(is_clock, is_clock_v): Define traits for C++20.
* include/std/condition_variable (condition_variable::wait_until): Add
check for valid clock.
* include/std/future (_State_baseV2::wait_until): Likewise.
* include/std/mutex (__timed_mutex_impl::_M_try_lock_until): Likewise.
* include/std/shared_mutex (shared_timed_mutex::try_lock_shared_until):
Likewise.
* include/std/thread (this_thread::sleep_until): Likewise.
* testsuite/30_threads/condition_variable/members/2.cc: Qualify
slow_clock with new namespace.
* testsuite/30_threads/condition_variable/members/clock_neg.cc: New
test.
* testsuite/30_threads/condition_variable_any/members/clock_neg.cc:
New test.
* testsuite/30_threads/future/members/clock_neg.cc: New test.
* testsuite/30_threads/recursive_timed_mutex/try_lock_until/3.cc:
Qualify slow_clock with new namespace.
* testsuite/30_threads/recursive_timed_mutex/try_lock_until/
clock_neg.cc: New test.
* testsuite/30_threads/shared_future/members/clock_neg.cc: New
test.
* testsuite/30_threads/shared_lock/locking/clock_neg.cc: New test.
* testsuite/30_threads/shared_timed_mutex/try_lock_until/clock_neg.cc:
New test.
* testsuite/30_threads/timed_mutex/try_lock_until/3.cc: Qualify
slow_clock with new namespace.
* testsuite/30_threads/timed_mutex/try_lock_until/4.cc: Likewise.
* testsuite/30_threads/timed_mutex/try_lock_until/clock_neg.cc: New
test.
* testsuite/30_threads/unique_lock/locking/clock_neg.cc: New test.
* testsuite/std/time/traits/is_clock.cc: New test.
* testsuite/util/slow_clock.h (slow_clock): Move to __gnu_test
namespace.
|
|
When the target doesn't define PTHREAD_RWLOCK_INITIALIZER we use a
wrapper around pthread_wrlock_init, but the wrapper only takes one
argument and we try to call it with two.
This went unnnoticed on most targets because they do define the
PTHREAD_RWLOCK_INITIALIZER macro, but it causes a bootstrap failure on
darwin8.
PR libstdc++/93244
* include/std/shared_mutex [!PTHREAD_RWLOCK_INITIALIZER]
(__shared_mutex_pthread::__shared_mutex_pthread()): Remove incorrect
second argument to __glibcxx_rwlock_init.
* testsuite/30_threads/shared_timed_mutex/94069.cc: New test.
|
|
From-SVN: r279813
|
|
This is the equivalent to PR libstdc++/91906, but for shared_mutex.
A non-standard clock may tick more slowly than std::chrono::steady_clock.
This means that we risk returning false early when the specified timeout
may not have expired. This can be avoided by looping until the timeout time
as reported by the non-standard clock has been reached.
Unfortunately, we have no way to tell whether the non-standard clock ticks
more quickly that std::chrono::steady_clock. If it does then we risk
returning later than would be expected, but that is unavoidable without
waking up periodically to check, which would be rather too expensive.
François Dumont pointed out[1] a flaw in an earlier version of this patch
that revealed a hole in the test coverage, so I've added a new test that
try_lock_until acts as try_lock if the timeout has already expired.
[1] https://gcc.gnu.org/ml/libstdc++/2019-10/msg00021.html
2019-12-02 Mike Crowe <mac@mcrowe.com>
Fix try_lock_until and try_lock_shared_until on arbitrary clock
* include/std/shared_mutex (shared_timed_mutex::try_lock_until)
(shared_timed_mutex::try_lock_shared_until): Loop until the absolute
timeout time is reached as measured against the appropriate clock.
* testsuite/30_threads/shared_timed_mutex/try_lock_until/1.cc: New
file. Test try_lock_until and try_lock_shared_until timeouts against
various clocks.
* testsuite/30_threads/shared_timed_mutex/try_lock_until/1.cc: New
file. Test try_lock_until and try_lock_shared_until timeouts against
various clocks.
From-SVN: r278904
|
|
The pthread_rwlock_clockrdlock and pthread_rwlock_clockwrlock functions
were added to glibc in v2.30. They have also been added to Android
Bionic. If these functions are available in the C library then they can
be used to implement shared_timed_mutex::try_lock_until,
shared_timed_mutex::try_lock_for,
shared_timed_mutex::try_lock_shared_until and
shared_timed_mutex::try_lock_shared_for so that they are no longer
unaffected by the system clock being warped. (This is the shared_mutex
equivalent of PR libstdc++/78237 for mutex.)
If the new functions are available then steady_clock is deemed to be the
"best" clock available which means that it is used for the relative
try_lock_for calls and absolute try_lock_until calls using steady_clock
and user-defined clocks. It's not possible to have
_GLIBCXX_USE_PTHREAD_RWLOCK_CLOCKLOCK defined without
_GLIBCXX_USE_PTHREAD_RWLOCK_T, so the requirement that the clock be the
same as condition_variable is maintained. Calls explicitly using
system_clock (aka high_resolution_clock) continue to use CLOCK_REALTIME
via the old pthread_rwlock_timedrdlock and pthread_rwlock_timedwrlock
functions.
If the new functions are not available then system_clock is deemed to be
the "best" clock available which means that the previous suboptimal
behaviour remains.
Additionally, the user-defined clock used with
shared_timed_mutex::try_lock_for and shared_mutex::try_lock_shared_for
may have higher precision than __clock_t. We may need to round the
duration up to ensure that the timeout is long enough. (See
__timed_mutex_impl::_M_try_lock_for)
2019-12-02 Mike Crowe <mac@mcrowe.com>
Add full steady_clock support to shared_timed_mutex
* acinclude.m4 (GLIBCXX_CHECK_PTHREAD_RWLOCK_CLOCKLOCK): Define
to check for the presence of both pthread_rwlock_clockrdlock and
pthread_rwlock_clockwrlock.
* config.h.in: Regenerate.
* configure.ac: Call GLIBCXX_USE_PTHREAD_RWLOCK_CLOCKLOCK.
* configure: Regenerate.
* include/std/shared_mutex (shared_timed_mutex): Define __clock_t as
the best clock to use for relative waits.
(shared_timed_mutex::try_lock_for) Round up wait duration if necessary.
(shared_timed_mutex::try_lock_shared_for): Likewise.
(shared_timed_mutex::try_lock_until): Use existing try_lock_until
implementation for system_clock (which matches __clock_t when
_GLIBCCXX_USE_PTHREAD_RWLOCK_CLOCKLOCK is not defined). Add new
overload for steady_clock that uses pthread_rwlock_clockwrlock if it
is available. Simplify overload for non-standard clock to just call
try_lock_for with a relative timeout.
(shared_timed_mutex::try_lock_shared_until): Likewise.
From-SVN: r278903
|
|
* include/bits/unique_lock.h: Fix/improve doxygen markup.
* include/std/mutex: Likewise.
* include/std/shared_mutex: Likewise.
From-SVN: r270812
|
|
From-SVN: r267494
|
|
Define the thread-safe pool resource, using a shared_mutex to allow
multiple threads to concurrently allocate from thread-specific pools.
Define new weak symbols for the pthread_rwlock_t functions, to avoid
making libstdc++.so depend on libpthread.so
When the necessary Gthread support is absent only define the
feature-test macro to 1, rather than 201603. This is intended to imply
incomplete support, because everything except synchronized_pool_resource
works.
Implement std::pmr::synchronized_pool_resource
* config/abi/pre/gnu.ver: Add new symbols.
* include/std/memory_resource [_GLIBCXX_HAS_GTHREADS]
(__cpp_lib_memory_resource): Define to expected value, 201603.
(synchronized_pool_resource): New class.
[!_GLIBCXX_HAS_GTHREADS] (__cpp_lib_memory_resource): Define to 1.
* include/std/shared_mutex (__glibcxx_rwlock_rdlock)
(__glibcxx_rwlock_tryrdlock, __glibcxx_rwlock_wrlock)
(__glibcxx_rwlock_trywrlock, __glibcxx_rwlock_unlock)
(__glibcxx_rwlock_destroy, __glibcxx_rwlock_init)
(__glibcxx_rwlock_timedrdlock, __glibcxx_rwlock_timedwrlock): Define
weak symbols for POSIX rwlock functions.
(__shared_mutex_pthread): Use weak symbols.
* include/std/version (__cpp_lib_memory_resource): Define.
* src/c++17/memory_resource.cc [_GLIBCXX_HAS_GTHREADS]
(synchronized_pool_resource::_TPools): New class.
(destroy_TPools): New function for pthread_key_create destructor.
(synchronized_pool_resource::synchronized_pool_resource)
(synchronized_pool_resource::~synchronized_pool_resource)
(synchronized_pool_resource::release)
(synchronized_pool_resource::do_allocate)
(synchronized_pool_resource::do_deallocate): Define public members.
(synchronized_pool_resource::_M_thread_specific_pools)
(synchronized_pool_resource::_M_alloc_tpools)
(synchronized_pool_resource::_M_alloc_shared_tpools): Define private
members.
* testsuite/20_util/synchronized_pool_resource/allocate.cc: New test.
* testsuite/20_util/synchronized_pool_resource/cons.cc: New test.
* testsuite/20_util/synchronized_pool_resource/is_equal.cc: New test.
* testsuite/20_util/synchronized_pool_resource/multithreaded.cc: New
test.
* testsuite/20_util/synchronized_pool_resource/release.cc: New test.
* testsuite/performance/20_util/memory_resource/pools.cc: Add
multithreaded tests using pmr::synchronized_pool_resource.
From-SVN: r266242
|
|
By adding fallback definitions of std::intmax_t and std::uintmax_t it's
possible to define <ratio> without _GLIBCXX_USE_C99_STDINT_TR1. This in
turn allows most of <chrono> to be defined, which removes the dependency
on _GLIBCXX_USE_C99_STDINT_TR1 for all of the C++11 concurrency features.
The compiler defines __INTMAX_TYPE__ and __UINTMAX_TYPE__
unconditionally so it should be safe to rely on them.
* include/bits/atomic_futex.h [!_GLIBCXX_USE_C99_STDINT_TR1]
(__atomic_futex_unsigned_base): Remove dependency on
_GLIBCXX_USE_C99_STDINT_TR1 macro.
* include/bits/unique_lock.h [!_GLIBCXX_USE_C99_STDINT_TR1]
(unique_lock): Remove dependency on _GLIBCXX_USE_C99_STDINT_TR1.
* include/c_global/cstdint [!_GLIBCXX_USE_C99_STDINT_TR1] (intmax_t)
(uintmax_t): Define using predefined macros.
* include/std/chrono [!_GLIBCXX_USE_C99_STDINT_TR1] (duration)
(time_point, system_clock, high_resolution_clock, steady_clock): Remove
dependency on _GLIBCXX_USE_C99_STDINT_TR1 macro.
(nanoseconds, microseconds, milliseconds, seconds, minutes, hours):
[!_GLIBCXX_USE_C99_STDINT_TR1]: Define using __INT64_TYPE__ or
long long when <stdint.h> is not usable.
* include/std/condition_variable [!_GLIBCXX_USE_C99_STDINT_TR1]
(condition_variable, condition_variable_any): Remove dependency on
_GLIBCXX_USE_C99_STDINT_TR1.
* include/std/future [!_GLIBCXX_USE_C99_STDINT_TR1] (future, promise)
(packaged_task, async): Likewise.
* include/std/mutex [!_GLIBCXX_USE_C99_STDINT_TR1] (recursive_mutex)
(timed_mutex, recursive_timed_mutex, try_lock, lock, scoped_lock)
(once_flag, call_once): Likewise.
* include/std/ratio [!_GLIBCXX_USE_C99_STDINT_TR1] (ratio): Likewise.
* include/std/shared_mutex [!_GLIBCXX_USE_C99_STDINT_TR1]
(shared_mutex, shared_timed_mutex, shared_lock): Likewise.
* include/std/thread [!_GLIBCXX_USE_C99_STDINT_TR1] (thread)
(this_thread::get_id, this_thread::yield, this_thread::sleep_for)
(this_thread::sleep_until): Likewise.
* src/c++11/chrono.cc: Remove dependency on
_GLIBCXX_USE_C99_STDINT_TR1 macro.
* src/c++11/condition_variable.cc: Likewise.
* src/c++11/futex.cc: Likewise.
* src/c++11/future.cc: Likewise.
* src/c++11/mutex.cc: Likewise.
* src/c++11/thread.cc: Likewise.
* testsuite/20_util/duration/literals/range_neg.cc: Adjust dg-error.
* 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/ratio/cons/cons_overflow_neg.cc: Likewise.
* testsuite/20_util/ratio/operations/ops_overflow_neg.cc: Likewise.
From-SVN: r263001
|
|
From-SVN: r256169
|
|
PR libstdc++/79433
* doc/xml/manual/status_cxx2017.xml: Update feature-test macros.
* doc/html/*: Regenerate.
* include/Makefile.am: Remove <bits/c++17_warning.h>.
* include/Makefile.in: Regenerate.
* include/bits/c++17_warning.h: Remove.
* include/bits/string_view.tcc: Do not include <bits/c++17_warning.h>
for pre-C++17 modes.
* include/std/any: Likewise.
(__cpp_lib_any): Define.
* include/std/mutex (__cpp_lib_scoped_lock): Adjust value as per new
SD-6 draft.
* include/std/numeric (__cpp_lib_gcd_lcm): Define as per new SD-6
draft.
* include/std/optional: Do not include <bits/c++17_warning.h>.
(__cpp_lib_optional): Define.
* include/std/shared_mutex: Do not include <bits/c++14_warning.h>.
* include/std/string_view: Do not include <bits/c++17_warning.h>.
(__cpp_lib_string_view): Define.
* include/std/variant: Do not include <bits/c++17_warning.h>.
(__cpp_lib_variant): Define.
* testsuite/20_util/optional/cons/value_neg.cc: Adjust dg-error line
numbers.
* testsuite/26_numerics/gcd/1.cc: Test for __cpp_lib_gcd_lcm.
* testsuite/26_numerics/gcd/gcd_neg.cc: Adjust dg-error line
numbers.
* testsuite/26_numerics/lcm/1.cc: Test for __cpp_lib_gcd_lcm.
* testsuite/26_numerics/lcm/lcm_neg.cc: Adjust dg-error line
numbers.
* testsuite/30_threads/scoped_lock/requirements/typedefs.cc: Adjust
expected value of __cpp_lib_scoped_lock.
From-SVN: r252018
|
|
From-SVN: r243994
|
|
* include/bits/allocator.h (__cpp_lib_incomplete_container_elements):
Define feature-test macro.
* include/bits/range_access.h (__cpp_lib_array_constexpr): Likewise.
* include/std/shared_mutex (__cpp_lib_shared_mutex): Uncomment.
* include/std/type_traits (__cpp_lib_logical_traits): Fix value.
(__cpp_lib_type_trait_variable_templates): Define.
From-SVN: r239088
|
|
PR libstdc++/70766
* include/bits/basic_ios.tcc (basic_ios::_M_cache_locale): Use
__addressof.
* include/bits/stream_iterator.h (istream_iterator, ostream_iterator):
Likewise.
* include/std/atomic (atomic<_Tp>): Likewise.
* include/std/shared_mutex (shared_lock): Likewise.
* testsuite/24_iterators/istream_iterator/70766.cc: New test.
* testsuite/24_iterators/ostream_iterator/70766.cc : New test.
* testsuite/29_atomics/atomic/60695.cc: Adjust dg-error line number.
* testsuite/29_atomics/atomic/70766.cc: New test.
* testsuite/30_threads/shared_lock/70766.cc: New test.
From-SVN: r235565
|
|
From-SVN: r232055
|
|
* doc/xml/manual/using.xml (_GLIBCXX_ASSERTIONS): Document.
* doc/html/manual/using_macros.html: Regenerate.
* include/bits/c++config: Define _GLIBCXX_ASSERTIONS when
_GLIBCXX_DEBUG is defined. Disable std::string extern templates when
(_GLIBCXX_EXTERN_TEMPLATE, __glibcxx_assert): Depend on
_GLIBCXX_ASSERTIONS instead of _GLIBCXX_DEBUG.
* include/debug/debug.h [!_GLIBCXX_DEBUG]: Define
__glibcxx_requires_non_empty_range and __glibcxx_requires_nonempty.
* include/backward/auto_ptr.h (auto_ptr::operator*,
auto_ptr::operator->): Replace _GLIBCXX_DEBUG_ASSERT with
__glibcxx_assert.
* include/bits/basic_string.h (basic_string::operator[],
basic_string::front, basic_string::back, basic_string::pop_back):
Likewise.
* include/bits/random.h
(uniform_int_distribution::param_type::param_type,
uniform_real_distribution::param_type::param_type,
normal_distribution::param_type::param_type,
gamma_distribution::param_type::param_type,
bernoulli_distribution::param_type::param_type,
binomial_distribution::param_type::param_type,
geometric_distribution::param_type::param_type,
negative_binomial_distribution::param_type::param_type,
poisson_distribution::param_type::param_type,
exponential_distribution::param_type::param_type): Likewise.
* include/bits/regex.h (match_results::operator[],
match_results::prefix, match_results::suffix): Likewise.
* include/bits/regex.tcc (format, regex_iterator::operator++):
Likewise.
* include/bits/regex_automaton.tcc (_StateSeq::_M_clone): Likewise.
* include/bits/regex_compiler.tcc (_Compiler::_Compiler,
_Compiler::_M_insert_character_class_matcher): Likewise.
* include/bits/regex_executor.tcc (_Executor::_M_dfs): Likewise.
* include/bits/regex_scanner.tcc (_Scanner::_M_advance,
_Scanner::_M_scan_normal): Likewise.
* include/bits/shared_ptr_base.h (__shared_ptr::_M_reset,
__shared_ptr::operator*): Likewise.
* include/bits/stl_iterator_base_funcs.h (__advance): Likewise.
* include/bits/unique_ptr.h (unique_ptr::operator*,
unique_ptr::operator[]): Likewise.
* include/experimental/fs_path.h (path::path(string_type, _Type),
path::iterator::operator++, path::iterator::operator--,
path::iterator::operator*): Likewise.
* include/experimental/string_view (basic_string_view::operator[],
basic_string_view::front, basic_string_view::back,
basic_string_view::remove_prefix): Likewise.
* include/ext/random (beta_distribution::param_type::param_type,
normal_mv_distribution::param_type::param_type,
rice_distribution::param_type::param_type,
pareto_distribution::param_type::param_type,
k_distribution::param_type::param_type,
arcsine_distribution::param_type::param_type,
hoyt_distribution::param_type::param_type,
triangular_distribution::param_type::param_type,
von_mises_distribution::param_type::param_type,
hypergeometric_distribution::param_type::param_type,
logistic_distribution::param_type::param_type): Likewise.
* include/ext/vstring.h (__versa_string::operator[]): Likewise.
* include/std/complex (polar): Likewise.
* include/std/mutex [!_GTHREAD_USE_MUTEX_TIMEDLOCK]
(timed_mutex::~timed_mutex, timed_mutex::unlock,
(recursive_timed_mutex::~timed_mutex, recursive_timed_mutex::unlock):
Likewise.
* include/std/shared_mutex [!PTHREAD_RWLOCK_INITIALIZER]
(__shared_mutex_pthread::__shared_mutex_pthread,
__shared_mutex_pthread::~__shared_mutex_pthread): Likewise.
(__shared_mutex_pthread::lock, __shared_mutex_pthread::try_lock,
__shared_mutex_pthread::unlock, __shared_mutex_pthread::lock_shared,
__shared_mutex_pthread::try_lock_shared): Likewise.
(__shared_mutex_cv::~__shared_mutex_cv, __shared_mutex_cv::unlock,
__shared_mutex_cv::unlock_shared): Likewise.
(shared_timed_mutex::try_lock_until,
shared_timed_mutex::try_lock_shared_until): Likewise.
* include/std/valarray (valarray::valarray(const _Tp*, size_t),
valarray::operator=, valarray::sum, valarray::min, valarray::max,
_DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT, _DEFINE_BINARY_OPERATOR):
Likewise.
From-SVN: r227595
|
|
* include/bits/shared_ptr_base.h: Add required header.
* include/std/condition_variable: Likewise.
* include/std/mutex: Remove unused header.
* include/std/shared_mutex: Remove redundant header.
(shared_mutex::shared_mutex()): Replace throw with __throw_bad_alloc.
From-SVN: r227469
|
|
2015-08-13 Eelis van der Weegen <eelis@eelis.net>
* include/std/shared_mutex (shared_mutex::unlock()): Fix typo.
From-SVN: r226862
|
|
the shared mutex requirements.
* include/std/shared_mutex (__shared_mutex_pthread,
__shared_mutex_cv): New helper types implementing the shared mutex
requirements.
(shared_mutex): New type for C++17.
(shared_timed_mutex): Derive from one of the new helper types.
* testsuite/30_threads/shared_mutex/cons/1.cc: New.
* testsuite/30_threads/shared_mutex/cons/assign_neg.cc: New.
* testsuite/30_threads/shared_mutex/cons/copy_neg.cc: New.
* testsuite/30_threads/shared_mutex/requirements/standard_layout.cc:
New.
* testsuite/30_threads/shared_mutex/try_lock/1.cc: New.
* testsuite/30_threads/shared_mutex/try_lock/2.cc: New.
From-SVN: r224158
|
|
Timeouts option is supported.
* include/std/shared_mutex (shared_timed_mutex): Only use
pthread_rwlock_t when the POSIX Timeouts option is supported.
* testsuite/30_threads/shared_lock/cons/5.cc: Remove
dg-require-gthreads-timed.
* testsuite/30_threads/shared_lock/cons/6.cc: Likewise.
* testsuite/30_threads/shared_lock/locking/3.cc: Likewise.
* testsuite/30_threads/shared_lock/locking/4.cc: Likewise.
From-SVN: r221971
|
|
non-pthread_rwlock_t version.
* include/std/shared_mutex (shared_timed_mutex): Add comments to
explain the logic in the non-pthread_rwlock_t version.
(_Mutex): Remove redundant type.
(_M_n_readers): Rename to _S_max_readers.
(_M_write_entered, _M_readers): New convenience functions.
(lock, lock_shared, try_lock_shared, unlock_shared): Use convenience
functions. Use predicates with condition variables. Simplify bitwise
operations.
(try_lock_for, try_shared_lock_for): Convert duration to time_point
and call try_lock_until or try_shared_lock_until respectively.
(try_lock_until, try_shared_lock_until): Wait on the condition
variables until the specified time passes.
(unlock): Add Debug Mode assertion.
(unlock_shared): Add Debug Mode assertion.
* testsuite/30_threads/shared_timed_mutex/try_lock/3.cc: New.
From-SVN: r221970
|
|
2015-03-18 Jonathan Wakely <jwakely@redhat.com>
Torvald Riegel <triegel@redhat.com>
* acinclude.m4 (GLIBCXX_CHECK_GTHREADS): Check for pthread_rwlock_t.
* config.h.in: Regenerate.
* configure: Regenerate.
* include/std/shared_mutex: Check _GLIBCXX_USE_PTHREAD_RWLOCK_T.
(shared_timed_mutex::_M_rwlock): Use PTHREAD_RWLOCK_INITIALIZER.
(shared_timed_mutex::lock_shared()): Retry on EAGAIN.
(shared_timed_mutex::try_lock_shared_until()): Retry on EAGAIN and
EDEADLK.
Co-Authored-By: Torvald Riegel <triegel@redhat.com>
From-SVN: r221484
|
|
* include/bits/atomic_base.h: Use __always_inline__ instead of
always_inline.
* include/bits/atomic_futex.h: Likewise.
* include/bits/c++config: Use __abi_tag__ instead of abi_tag.
* include/ext/pb_ds/detail/gp_hash_table_map_/gp_ht_map_.hpp: Use
__packed__ instead of packed.
* include/std/shared_mutex: Use __unused__ instead of unused.
* testsuite/17_intro/headers/c++1998/all_attributes.cc: New.
* testsuite/17_intro/headers/c++200x/all_attributes.cc: New.
* testsuite/17_intro/headers/c++2014/all_attributes.cc: New.
From-SVN: r220243
|
|
after r218964.)
PR libstdc++/64368
* include/std/shared_mutex (shared_timed_mutex::try_lock_for,
shared_timed_mutex::try_lock_until): Only define when POSIX thread
timeouts option is supported.
(shared_timed_mutex::try_shared_lock_for,
shared_timed_mutex::try_shared_lock_until): Likewise.
From-SVN: r220161
|
|
* include/std/shared_mutex (shared_timed_mutex): Add POSIX-based
implementation.
From-SVN: r219737
|
|
From-SVN: r219188
|
|
PR libstdc++/64203
* include/std/shared_mutex: Fix preprocessor conditions.
* testsuite/experimental/feat-cxx14.cc: Check conditions.
From-SVN: r218511
|
|
2014-10-01 Edward Smith-Rowland <3dw4rd@verizon.net>
Implement SD-6: SG10 Feature Test Recommendations
* internal.h (lexer_state, spec_nodes): Add in__has_include__.
* directives.c: Support __has_include__ builtin.
* expr.c (parse_has_include): New function to parse __has_include__
builtin; (eval_token()): Use it.
* files.c (_cpp_has_header()): New funtion to look for header;
(open_file_failed()): Not an error to not find a header file for
__has_include__.
* identifiers.c (_cpp_init_hashtable()): Add entry for __has_include__.
* pch.c (cpp_read_state): Lookup __has_include__.
* traditional.c (enum ls, _cpp_scan_out_logical_line()): Walk through
__has_include__ statements.
2014-10-01 Edward Smith-Rowland <3dw4rd@verizon.net>
Implement SD-6: SG10 Feature Test Recommendations
* c-cppbuiltin.c (c_cpp_builtins()): Define language feature
macros and the __has_header macro.
2014-10-01 Edward Smith-Rowland <3dw4rd@verizon.net>
Implement SD-6: SG10 Feature Test Recommendations
* include/bits/basic_string.h: Add __cpp_lib feature test macro.
* include/bits/stl_algobase.h: Ditto.
* include/bits/stl_function.h: Ditto.
* include/bits/unique_ptr.h: Ditto.
* include/std/chrono: Ditto.
* include/std/complex: Ditto.
* include/std/iomanip: Ditto.
* include/std/shared_mutex: Ditto.
* include/std/tuple: Ditto.
* include/std/type_traits: Ditto.
* include/std/utility: Ditto.
* testsuite/experimental/feat-cxx14.cc: New.
* testsuite/experimental/feat-lib-fund.cc: New.
* testsuite/20_util/declval/requirements/1_neg.cc: Adjust.
* testsuite/20_util/duration/literals/range.cc: Adjust.
* testsuite/20_util/duration/requirements/typedefs_neg1.cc: Adjust.
* testsuite/20_util/duration/requirements/typedefs_neg2.cc: Adjust.
* testsuite/20_util/duration/requirements/typedefs_neg3.cc: Adjust.
* testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Adjust.
* testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc: Adjust.
* testsuite/23_containers/array/tuple_interface/get_neg.cc: Adjust.
* testsuite/23_containers/array/tuple_interface/tuple_element_neg.cc:
Adjust.
2014-10-01 Edward Smith-Rowland <3dw4rd@verizon.net>
Implement SD-6: SG10 Feature Test Recommendations
* g++.dg/cpp1y/feat-cxx11-neg.C: New.
* g++.dg/cpp1y/feat-cxx11.C: New.
* g++.dg/cpp1y/feat-cxx14.C: New.
* g++.dg/cpp1y/feat-cxx98.C: New.
* g++.dg/cpp1y/feat-cxx98-neg.C: New.
* g++.dg/cpp1y/phoobhar.h: New.
* g++.dg/cpp1y/testinc/phoobhar.h: New.
From-SVN: r215752
|
|
2014-02-20 Ed Smith-Rowland <3dw4rd@verizon.net>
Rename shared_mutex to shared_timed_mutex per C++14 acceptance of N3891.
* include/std/shared_mutex: Rename shared_mutex to shared_timed_mutex.
* testsuite/30_threads/shared_lock/locking/2.cc: Ditto.
* testsuite/30_threads/shared_lock/locking/4.cc: Ditto.
* testsuite/30_threads/shared_lock/locking/1.cc: Ditto.
* testsuite/30_threads/shared_lock/locking/3.cc: Ditto.
* testsuite/30_threads/shared_lock/requirements/
explicit_instantiation.cc: Ditto.
* testsuite/30_threads/shared_lock/requirements/typedefs.cc: Ditto.
* testsuite/30_threads/shared_lock/cons/2.cc: Ditto.
* testsuite/30_threads/shared_lock/cons/4.cc: Ditto.
* testsuite/30_threads/shared_lock/cons/1.cc: Ditto.
* testsuite/30_threads/shared_lock/cons/6.cc: Ditto.
* testsuite/30_threads/shared_lock/cons/3.cc: Ditto.
* testsuite/30_threads/shared_lock/cons/5.cc: Ditto.
* testsuite/30_threads/shared_lock/modifiers/2.cc: Ditto.
* testsuite/30_threads/shared_lock/modifiers/1.cc: Ditto.
* testsuite/30_threads/shared_mutex/requirements/
standard_layout.cc: Ditto.
* testsuite/30_threads/shared_mutex/cons/copy_neg.cc: Ditto.
* testsuite/30_threads/shared_mutex/cons/1.cc: Ditto.
* testsuite/30_threads/shared_mutex/cons/assign_neg.cc: Ditto.
* testsuite/30_threads/shared_mutex/try_lock/2.cc: Ditto.
* testsuite/30_threads/shared_mutex/try_lock/1.cc: Ditto.
From-SVN: r207964
|
|
From-SVN: r206301
|
|
PR libstdc++/57641
* include/std/mutex (timed_mutex, recursive_timed_mutex): Move common
functionality to new __timed_mutex_impl mixin. Overload try_lock_until
to handle conversion between different clocks. Replace constrained
__try_lock_for_impl overloads with conditional increment.
* include/std/shared_mutex (shared_mutex::_Mutex): Use the new mixin.
* testsuite/30_threads/timed_mutex/try_lock_until/57641.cc: New.
From-SVN: r200180
|
|
* include/std/shared_mutex (shared_lock::operator=): Add missing
return statement.
From-SVN: r200141
|
|
* include/std/shared_mutex: Implement N3659.
* include/bits/c++14_warning.h: New.
* include/Makefile.am: Add new headers.
* include/Makefile.in: Regenerate.
* testsuite/30_threads/shared_lock/cons/1.cc: New.
* testsuite/30_threads/shared_lock/locking/2.cc: New.
* testsuite/30_threads/shared_lock/cons/2.cc: New.
* testsuite/30_threads/shared_lock/locking/3.cc: New.
* testsuite/30_threads/shared_lock/cons/3.cc: New.
* testsuite/30_threads/shared_lock/locking/4.cc: New.
* testsuite/30_threads/shared_lock/cons/4.cc: New.
* testsuite/30_threads/shared_lock/modifiers/1.cc: New.
* testsuite/30_threads/shared_lock/cons/5.cc: New.
* testsuite/30_threads/shared_lock/modifiers/2.cc: New.
* testsuite/30_threads/shared_lock/cons/6.cc: New.
* testsuite/30_threads/shared_lock/requirements/
explicit_instantiation.cc: New.
* testsuite/30_threads/shared_lock/locking/1.cc: New.
* testsuite/30_threads/shared_lock/requirements/typedefs.cc: New.
* testsuite/30_threads/shared_mutex/cons/1.cc: New.
* testsuite/30_threads/shared_mutex/cons/assign_neg.cc: New.
* testsuite/30_threads/shared_mutex/cons/copy_neg.cc: New.
* testsuite/30_threads/shared_mutex/requirements/
standard_layout.cc: New.
* testsuite/30_threads/shared_mutex/try_lock/1.cc: New.
* testsuite/30_threads/shared_mutex/try_lock/2.cc: New.
From-SVN: r200134
|