Export of internal Abseil changes
-- 0e867881e4b9f388a13d6fa8ed715192460130ab by Abseil Team <absl-team@google.com>: Minor wording change to header comment for Mutex::AwaitWithDeadline(). No functional changes. PiperOrigin-RevId: 306729491 -- fc64361fb831003fa5e6fbb84a9a89338fd2838c by Derek Mauro <dmauro@google.com>: Uses C++20 compatible allocator traits in Abseil types This merges both instances of CountingAllocator in the Abseil codebase. Makes the presubmits test C++20 mode. Fixes #651 PiperOrigin-RevId: 306728102 -- d759e5681b9dd6b7339fc019ed58fb5fdececdc3 by Derek Mauro <dmauro@google.com>: Makes btree's iterator comparisons C++20 compatible See https://stackoverflow.com/questions/60386792/c20-comparison-warning-about-ambiguous-reversed-operator PiperOrigin-RevId: 306702048 -- e9da5f409bc5ddb1bad308f9d8c41213c67a1d1e by Derek Mauro <dmauro@google.com>: Switch a few uses of at() that should have been data() in the implementation of InlinedVector. Use ABSL_HARDENING_ASSERT in resize(). PiperOrigin-RevId: 306670992 GitOrigin-RevId: 0e867881e4b9f388a13d6fa8ed715192460130ab Change-Id: If431f3e5d77097e9901654773552dcc01dface87
This commit is contained in:
		
							parent
							
								
									71079e42cb
								
							
						
					
					
						commit
						db5773a721
					
				
					 13 changed files with 90 additions and 108 deletions
				
			
		|  | @ -73,6 +73,7 @@ cc_test( | ||||||
|     copts = ABSL_TEST_COPTS, |     copts = ABSL_TEST_COPTS, | ||||||
|     linkopts = ABSL_DEFAULT_LINKOPTS, |     linkopts = ABSL_DEFAULT_LINKOPTS, | ||||||
|     deps = [ |     deps = [ | ||||||
|  |         ":counting_allocator", | ||||||
|         ":fixed_array", |         ":fixed_array", | ||||||
|         "//absl/base:config", |         "//absl/base:config", | ||||||
|         "//absl/base:exception_testing", |         "//absl/base:exception_testing", | ||||||
|  |  | ||||||
|  | @ -147,6 +147,7 @@ absl_cc_test( | ||||||
|     ${ABSL_TEST_COPTS} |     ${ABSL_TEST_COPTS} | ||||||
|   DEPS |   DEPS | ||||||
|     absl::fixed_array |     absl::fixed_array | ||||||
|  |     absl::counting_allocator | ||||||
|     absl::config |     absl::config | ||||||
|     absl::exception_testing |     absl::exception_testing | ||||||
|     absl::hash_testing |     absl::hash_testing | ||||||
|  |  | ||||||
|  | @ -106,13 +106,13 @@ class FixedArray { | ||||||
| 
 | 
 | ||||||
|  public: |  public: | ||||||
|   using allocator_type = typename AllocatorTraits::allocator_type; |   using allocator_type = typename AllocatorTraits::allocator_type; | ||||||
|   using value_type = typename allocator_type::value_type; |   using value_type = typename AllocatorTraits::value_type; | ||||||
|   using pointer = typename allocator_type::pointer; |   using pointer = typename AllocatorTraits::pointer; | ||||||
|   using const_pointer = typename allocator_type::const_pointer; |   using const_pointer = typename AllocatorTraits::const_pointer; | ||||||
|   using reference = typename allocator_type::reference; |   using reference = value_type&; | ||||||
|   using const_reference = typename allocator_type::const_reference; |   using const_reference = const value_type&; | ||||||
|   using size_type = typename allocator_type::size_type; |   using size_type = typename AllocatorTraits::size_type; | ||||||
|   using difference_type = typename allocator_type::difference_type; |   using difference_type = typename AllocatorTraits::difference_type; | ||||||
|   using iterator = pointer; |   using iterator = pointer; | ||||||
|   using const_iterator = const_pointer; |   using const_iterator = const_pointer; | ||||||
|   using reverse_iterator = std::reverse_iterator<iterator>; |   using reverse_iterator = std::reverse_iterator<iterator>; | ||||||
|  |  | ||||||
|  | @ -29,6 +29,7 @@ | ||||||
| #include "gtest/gtest.h" | #include "gtest/gtest.h" | ||||||
| #include "absl/base/internal/exception_testing.h" | #include "absl/base/internal/exception_testing.h" | ||||||
| #include "absl/base/options.h" | #include "absl/base/options.h" | ||||||
|  | #include "absl/container/internal/counting_allocator.h" | ||||||
| #include "absl/hash/hash_testing.h" | #include "absl/hash/hash_testing.h" | ||||||
| #include "absl/memory/memory.h" | #include "absl/memory/memory.h" | ||||||
| 
 | 
 | ||||||
|  | @ -638,70 +639,9 @@ TEST(FixedArrayTest, DefaultCtorDoesNotValueInit) { | ||||||
| } | } | ||||||
| #endif  // __GNUC__
 | #endif  // __GNUC__
 | ||||||
| 
 | 
 | ||||||
| // This is a stateful allocator, but the state lives outside of the
 |  | ||||||
| // allocator (in whatever test is using the allocator). This is odd
 |  | ||||||
| // but helps in tests where the allocator is propagated into nested
 |  | ||||||
| // containers - that chain of allocators uses the same state and is
 |  | ||||||
| // thus easier to query for aggregate allocation information.
 |  | ||||||
| template <typename T> |  | ||||||
| class CountingAllocator : public std::allocator<T> { |  | ||||||
|  public: |  | ||||||
|   using Alloc = std::allocator<T>; |  | ||||||
|   using pointer = typename Alloc::pointer; |  | ||||||
|   using size_type = typename Alloc::size_type; |  | ||||||
| 
 |  | ||||||
|   CountingAllocator() : bytes_used_(nullptr), instance_count_(nullptr) {} |  | ||||||
|   explicit CountingAllocator(int64_t* b) |  | ||||||
|       : bytes_used_(b), instance_count_(nullptr) {} |  | ||||||
|   CountingAllocator(int64_t* b, int64_t* a) |  | ||||||
|       : bytes_used_(b), instance_count_(a) {} |  | ||||||
| 
 |  | ||||||
|   template <typename U> |  | ||||||
|   explicit CountingAllocator(const CountingAllocator<U>& x) |  | ||||||
|       : Alloc(x), |  | ||||||
|         bytes_used_(x.bytes_used_), |  | ||||||
|         instance_count_(x.instance_count_) {} |  | ||||||
| 
 |  | ||||||
|   pointer allocate(size_type n, const void* const hint = nullptr) { |  | ||||||
|     assert(bytes_used_ != nullptr); |  | ||||||
|     *bytes_used_ += n * sizeof(T); |  | ||||||
|     return Alloc::allocate(n, hint); |  | ||||||
|   } |  | ||||||
| 
 |  | ||||||
|   void deallocate(pointer p, size_type n) { |  | ||||||
|     Alloc::deallocate(p, n); |  | ||||||
|     assert(bytes_used_ != nullptr); |  | ||||||
|     *bytes_used_ -= n * sizeof(T); |  | ||||||
|   } |  | ||||||
| 
 |  | ||||||
|   template <typename... Args> |  | ||||||
|   void construct(pointer p, Args&&... args) { |  | ||||||
|     Alloc::construct(p, absl::forward<Args>(args)...); |  | ||||||
|     if (instance_count_) { |  | ||||||
|       *instance_count_ += 1; |  | ||||||
|     } |  | ||||||
|   } |  | ||||||
| 
 |  | ||||||
|   void destroy(pointer p) { |  | ||||||
|     Alloc::destroy(p); |  | ||||||
|     if (instance_count_) { |  | ||||||
|       *instance_count_ -= 1; |  | ||||||
|     } |  | ||||||
|   } |  | ||||||
| 
 |  | ||||||
|   template <typename U> |  | ||||||
|   class rebind { |  | ||||||
|    public: |  | ||||||
|     using other = CountingAllocator<U>; |  | ||||||
|   }; |  | ||||||
| 
 |  | ||||||
|   int64_t* bytes_used_; |  | ||||||
|   int64_t* instance_count_; |  | ||||||
| }; |  | ||||||
| 
 |  | ||||||
| TEST(AllocatorSupportTest, CountInlineAllocations) { | TEST(AllocatorSupportTest, CountInlineAllocations) { | ||||||
|   constexpr size_t inlined_size = 4; |   constexpr size_t inlined_size = 4; | ||||||
|   using Alloc = CountingAllocator<int>; |   using Alloc = absl::container_internal::CountingAllocator<int>; | ||||||
|   using AllocFxdArr = absl::FixedArray<int, inlined_size, Alloc>; |   using AllocFxdArr = absl::FixedArray<int, inlined_size, Alloc>; | ||||||
| 
 | 
 | ||||||
|   int64_t allocated = 0; |   int64_t allocated = 0; | ||||||
|  | @ -722,7 +662,7 @@ TEST(AllocatorSupportTest, CountInlineAllocations) { | ||||||
| 
 | 
 | ||||||
| TEST(AllocatorSupportTest, CountOutoflineAllocations) { | TEST(AllocatorSupportTest, CountOutoflineAllocations) { | ||||||
|   constexpr size_t inlined_size = 4; |   constexpr size_t inlined_size = 4; | ||||||
|   using Alloc = CountingAllocator<int>; |   using Alloc = absl::container_internal::CountingAllocator<int>; | ||||||
|   using AllocFxdArr = absl::FixedArray<int, inlined_size, Alloc>; |   using AllocFxdArr = absl::FixedArray<int, inlined_size, Alloc>; | ||||||
| 
 | 
 | ||||||
|   int64_t allocated = 0; |   int64_t allocated = 0; | ||||||
|  | @ -743,7 +683,7 @@ TEST(AllocatorSupportTest, CountOutoflineAllocations) { | ||||||
| 
 | 
 | ||||||
| TEST(AllocatorSupportTest, CountCopyInlineAllocations) { | TEST(AllocatorSupportTest, CountCopyInlineAllocations) { | ||||||
|   constexpr size_t inlined_size = 4; |   constexpr size_t inlined_size = 4; | ||||||
|   using Alloc = CountingAllocator<int>; |   using Alloc = absl::container_internal::CountingAllocator<int>; | ||||||
|   using AllocFxdArr = absl::FixedArray<int, inlined_size, Alloc>; |   using AllocFxdArr = absl::FixedArray<int, inlined_size, Alloc>; | ||||||
| 
 | 
 | ||||||
|   int64_t allocated1 = 0; |   int64_t allocated1 = 0; | ||||||
|  | @ -771,7 +711,7 @@ TEST(AllocatorSupportTest, CountCopyInlineAllocations) { | ||||||
| 
 | 
 | ||||||
| TEST(AllocatorSupportTest, CountCopyOutoflineAllocations) { | TEST(AllocatorSupportTest, CountCopyOutoflineAllocations) { | ||||||
|   constexpr size_t inlined_size = 4; |   constexpr size_t inlined_size = 4; | ||||||
|   using Alloc = CountingAllocator<int>; |   using Alloc = absl::container_internal::CountingAllocator<int>; | ||||||
|   using AllocFxdArr = absl::FixedArray<int, inlined_size, Alloc>; |   using AllocFxdArr = absl::FixedArray<int, inlined_size, Alloc>; | ||||||
| 
 | 
 | ||||||
|   int64_t allocated1 = 0; |   int64_t allocated1 = 0; | ||||||
|  | @ -803,7 +743,7 @@ TEST(AllocatorSupportTest, SizeValAllocConstructor) { | ||||||
|   using testing::SizeIs; |   using testing::SizeIs; | ||||||
| 
 | 
 | ||||||
|   constexpr size_t inlined_size = 4; |   constexpr size_t inlined_size = 4; | ||||||
|   using Alloc = CountingAllocator<int>; |   using Alloc = absl::container_internal::CountingAllocator<int>; | ||||||
|   using AllocFxdArr = absl::FixedArray<int, inlined_size, Alloc>; |   using AllocFxdArr = absl::FixedArray<int, inlined_size, Alloc>; | ||||||
| 
 | 
 | ||||||
|   { |   { | ||||||
|  |  | ||||||
|  | @ -351,14 +351,14 @@ class InlinedVector { | ||||||
|   // Returns a `reference` to the first element of the inlined vector.
 |   // Returns a `reference` to the first element of the inlined vector.
 | ||||||
|   reference front() { |   reference front() { | ||||||
|     ABSL_HARDENING_ASSERT(!empty()); |     ABSL_HARDENING_ASSERT(!empty()); | ||||||
|     return at(0); |     return data()[0]; | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   // Overload of `InlinedVector::front()` that returns a `const_reference` to
 |   // Overload of `InlinedVector::front()` that returns a `const_reference` to
 | ||||||
|   // the first element of the inlined vector.
 |   // the first element of the inlined vector.
 | ||||||
|   const_reference front() const { |   const_reference front() const { | ||||||
|     ABSL_HARDENING_ASSERT(!empty()); |     ABSL_HARDENING_ASSERT(!empty()); | ||||||
|     return at(0); |     return data()[0]; | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   // `InlinedVector::back()`
 |   // `InlinedVector::back()`
 | ||||||
|  | @ -366,14 +366,14 @@ class InlinedVector { | ||||||
|   // Returns a `reference` to the last element of the inlined vector.
 |   // Returns a `reference` to the last element of the inlined vector.
 | ||||||
|   reference back() { |   reference back() { | ||||||
|     ABSL_HARDENING_ASSERT(!empty()); |     ABSL_HARDENING_ASSERT(!empty()); | ||||||
|     return at(size() - 1); |     return data()[size() - 1]; | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   // Overload of `InlinedVector::back()` that returns a `const_reference` to the
 |   // Overload of `InlinedVector::back()` that returns a `const_reference` to the
 | ||||||
|   // last element of the inlined vector.
 |   // last element of the inlined vector.
 | ||||||
|   const_reference back() const { |   const_reference back() const { | ||||||
|     ABSL_HARDENING_ASSERT(!empty()); |     ABSL_HARDENING_ASSERT(!empty()); | ||||||
|     return at(size() - 1); |     return data()[size() - 1]; | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   // `InlinedVector::begin()`
 |   // `InlinedVector::begin()`
 | ||||||
|  | @ -524,7 +524,7 @@ class InlinedVector { | ||||||
|   void assign(InputIterator first, InputIterator last) { |   void assign(InputIterator first, InputIterator last) { | ||||||
|     size_type i = 0; |     size_type i = 0; | ||||||
|     for (; i < size() && first != last; ++i, static_cast<void>(++first)) { |     for (; i < size() && first != last; ++i, static_cast<void>(++first)) { | ||||||
|       at(i) = *first; |       data()[i] = *first; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     erase(data() + i, data() + size()); |     erase(data() + i, data() + size()); | ||||||
|  | @ -537,7 +537,10 @@ class InlinedVector { | ||||||
|   //
 |   //
 | ||||||
|   // NOTE: if `n` is smaller than `size()`, extra elements are destroyed. If `n`
 |   // NOTE: if `n` is smaller than `size()`, extra elements are destroyed. If `n`
 | ||||||
|   // is larger than `size()`, new elements are value-initialized.
 |   // is larger than `size()`, new elements are value-initialized.
 | ||||||
|   void resize(size_type n) { storage_.Resize(DefaultValueAdapter(), n); } |   void resize(size_type n) { | ||||||
|  |     ABSL_HARDENING_ASSERT(n <= max_size()); | ||||||
|  |     storage_.Resize(DefaultValueAdapter(), n); | ||||||
|  |   } | ||||||
| 
 | 
 | ||||||
|   // Overload of `InlinedVector::resize(...)` that resizes the inlined vector to
 |   // Overload of `InlinedVector::resize(...)` that resizes the inlined vector to
 | ||||||
|   // contain `n` elements.
 |   // contain `n` elements.
 | ||||||
|  | @ -545,6 +548,7 @@ class InlinedVector { | ||||||
|   // NOTE: if `n` is smaller than `size()`, extra elements are destroyed. If `n`
 |   // NOTE: if `n` is smaller than `size()`, extra elements are destroyed. If `n`
 | ||||||
|   // is larger than `size()`, new elements are copied-constructed from `v`.
 |   // is larger than `size()`, new elements are copied-constructed from `v`.
 | ||||||
|   void resize(size_type n, const_reference v) { |   void resize(size_type n, const_reference v) { | ||||||
|  |     ABSL_HARDENING_ASSERT(n <= max_size()); | ||||||
|     storage_.Resize(CopyValueAdapter(v), n); |     storage_.Resize(CopyValueAdapter(v), n); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -929,9 +929,15 @@ struct btree_iterator { | ||||||
|   void decrement_slow(); |   void decrement_slow(); | ||||||
| 
 | 
 | ||||||
|  public: |  public: | ||||||
|  |   bool operator==(const iterator &other) const { | ||||||
|  |     return node == other.node && position == other.position; | ||||||
|  |   } | ||||||
|   bool operator==(const const_iterator &other) const { |   bool operator==(const const_iterator &other) const { | ||||||
|     return node == other.node && position == other.position; |     return node == other.node && position == other.position; | ||||||
|   } |   } | ||||||
|  |   bool operator!=(const iterator &other) const { | ||||||
|  |     return node != other.node || position != other.position; | ||||||
|  |   } | ||||||
|   bool operator!=(const const_iterator &other) const { |   bool operator!=(const const_iterator &other) const { | ||||||
|     return node != other.node || position != other.position; |     return node != other.node || position != other.position; | ||||||
|   } |   } | ||||||
|  |  | ||||||
|  | @ -15,7 +15,6 @@ | ||||||
| #ifndef ABSL_CONTAINER_INTERNAL_COUNTING_ALLOCATOR_H_ | #ifndef ABSL_CONTAINER_INTERNAL_COUNTING_ALLOCATOR_H_ | ||||||
| #define ABSL_CONTAINER_INTERNAL_COUNTING_ALLOCATOR_H_ | #define ABSL_CONTAINER_INTERNAL_COUNTING_ALLOCATOR_H_ | ||||||
| 
 | 
 | ||||||
| #include <cassert> |  | ||||||
| #include <cstdint> | #include <cstdint> | ||||||
| #include <memory> | #include <memory> | ||||||
| 
 | 
 | ||||||
|  | @ -31,31 +30,61 @@ namespace container_internal { | ||||||
| // containers - that chain of allocators uses the same state and is
 | // containers - that chain of allocators uses the same state and is
 | ||||||
| // thus easier to query for aggregate allocation information.
 | // thus easier to query for aggregate allocation information.
 | ||||||
| template <typename T> | template <typename T> | ||||||
| class CountingAllocator : public std::allocator<T> { | class CountingAllocator { | ||||||
|  public: |  public: | ||||||
|   using Alloc = std::allocator<T>; |   using Allocator = std::allocator<T>; | ||||||
|   using pointer = typename Alloc::pointer; |   using AllocatorTraits = std::allocator_traits<Allocator>; | ||||||
|   using size_type = typename Alloc::size_type; |   using value_type = typename AllocatorTraits::value_type; | ||||||
|  |   using pointer = typename AllocatorTraits::pointer; | ||||||
|  |   using const_pointer = typename AllocatorTraits::const_pointer; | ||||||
|  |   using size_type = typename AllocatorTraits::size_type; | ||||||
|  |   using difference_type = typename AllocatorTraits::difference_type; | ||||||
| 
 | 
 | ||||||
|   CountingAllocator() : bytes_used_(nullptr) {} |   CountingAllocator() = default; | ||||||
|   explicit CountingAllocator(int64_t* b) : bytes_used_(b) {} |   explicit CountingAllocator(int64_t* bytes_used) : bytes_used_(bytes_used) {} | ||||||
|  |   CountingAllocator(int64_t* bytes_used, int64_t* instance_count) | ||||||
|  |       : bytes_used_(bytes_used), instance_count_(instance_count) {} | ||||||
| 
 | 
 | ||||||
|   template <typename U> |   template <typename U> | ||||||
|   CountingAllocator(const CountingAllocator<U>& x) |   CountingAllocator(const CountingAllocator<U>& x) | ||||||
|       : Alloc(x), bytes_used_(x.bytes_used_) {} |       : bytes_used_(x.bytes_used_), instance_count_(x.instance_count_) {} | ||||||
| 
 | 
 | ||||||
|   pointer allocate(size_type n, |   pointer allocate( | ||||||
|                    std::allocator<void>::const_pointer hint = nullptr) { |       size_type n, | ||||||
|     assert(bytes_used_ != nullptr); |       typename AllocatorTraits::const_void_pointer hint = nullptr) { | ||||||
|  |     Allocator allocator; | ||||||
|  |     pointer ptr = AllocatorTraits::allocate(allocator, n, hint); | ||||||
|  |     if (bytes_used_ != nullptr) { | ||||||
|       *bytes_used_ += n * sizeof(T); |       *bytes_used_ += n * sizeof(T); | ||||||
|     return Alloc::allocate(n, hint); |     } | ||||||
|  |     return ptr; | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   void deallocate(pointer p, size_type n) { |   void deallocate(pointer p, size_type n) { | ||||||
|     Alloc::deallocate(p, n); |     Allocator allocator; | ||||||
|     assert(bytes_used_ != nullptr); |     AllocatorTraits::deallocate(allocator, p, n); | ||||||
|  |     if (bytes_used_ != nullptr) { | ||||||
|       *bytes_used_ -= n * sizeof(T); |       *bytes_used_ -= n * sizeof(T); | ||||||
|     } |     } | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   template <typename U, typename... Args> | ||||||
|  |   void construct(U* p, Args&&... args) { | ||||||
|  |     Allocator allocator; | ||||||
|  |     AllocatorTraits::construct(allocator, p, std::forward<Args>(args)...); | ||||||
|  |     if (instance_count_ != nullptr) { | ||||||
|  |       *instance_count_ += 1; | ||||||
|  |     } | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   template <typename U> | ||||||
|  |   void destroy(U* p) { | ||||||
|  |     Allocator allocator; | ||||||
|  |     AllocatorTraits::destroy(allocator, p); | ||||||
|  |     if (instance_count_ != nullptr) { | ||||||
|  |       *instance_count_ -= 1; | ||||||
|  |     } | ||||||
|  |   } | ||||||
| 
 | 
 | ||||||
|   template <typename U> |   template <typename U> | ||||||
|   class rebind { |   class rebind { | ||||||
|  | @ -65,7 +94,8 @@ class CountingAllocator : public std::allocator<T> { | ||||||
| 
 | 
 | ||||||
|   friend bool operator==(const CountingAllocator& a, |   friend bool operator==(const CountingAllocator& a, | ||||||
|                          const CountingAllocator& b) { |                          const CountingAllocator& b) { | ||||||
|     return a.bytes_used_ == b.bytes_used_; |     return a.bytes_used_ == b.bytes_used_ && | ||||||
|  |            a.instance_count_ == b.instance_count_; | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   friend bool operator!=(const CountingAllocator& a, |   friend bool operator!=(const CountingAllocator& a, | ||||||
|  | @ -73,7 +103,8 @@ class CountingAllocator : public std::allocator<T> { | ||||||
|     return !(a == b); |     return !(a == b); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   int64_t* bytes_used_; |   int64_t* bytes_used_ = nullptr; | ||||||
|  |   int64_t* instance_count_ = nullptr; | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| }  // namespace container_internal
 | }  // namespace container_internal
 | ||||||
|  |  | ||||||
|  | @ -331,17 +331,16 @@ class ABSL_LOCKABLE Mutex { | ||||||
|   // Mutex::AwaitWithTimeout()
 |   // Mutex::AwaitWithTimeout()
 | ||||||
|   // Mutex::AwaitWithDeadline()
 |   // Mutex::AwaitWithDeadline()
 | ||||||
|   //
 |   //
 | ||||||
|   // If `cond` is initially true, do nothing, or act as though `cond` is
 |   // Unlocks this `Mutex` and blocks until simultaneously:
 | ||||||
|   // initially false.
 |  | ||||||
|   //
 |  | ||||||
|   // If `cond` is initially false, unlock this `Mutex` and block until
 |  | ||||||
|   // simultaneously:
 |  | ||||||
|   //   - either `cond` is true or the {timeout has expired, deadline has passed}
 |   //   - either `cond` is true or the {timeout has expired, deadline has passed}
 | ||||||
|   //     and
 |   //     and
 | ||||||
|   //   - this `Mutex` can be reacquired,
 |   //   - this `Mutex` can be reacquired,
 | ||||||
|   // then reacquire this `Mutex` in the same mode in which it was previously
 |   // then reacquire this `Mutex` in the same mode in which it was previously
 | ||||||
|   // held, returning `true` iff `cond` is `true` on return.
 |   // held, returning `true` iff `cond` is `true` on return.
 | ||||||
|   //
 |   //
 | ||||||
|  |   // If the condition is initially `true`, the implementation *may* skip the
 | ||||||
|  |   // release/re-acquire step and return immediately.
 | ||||||
|  |   //
 | ||||||
|   // Deadlines in the past are equivalent to an immediate deadline.
 |   // Deadlines in the past are equivalent to an immediate deadline.
 | ||||||
|   // Negative timeouts are equivalent to a zero timeout.
 |   // Negative timeouts are equivalent to a zero timeout.
 | ||||||
|   //
 |   //
 | ||||||
|  |  | ||||||
|  | @ -25,7 +25,7 @@ if [[ -z ${ABSEIL_ROOT:-} ]]; then | ||||||
| fi | fi | ||||||
| 
 | 
 | ||||||
| if [[ -z ${STD:-} ]]; then | if [[ -z ${STD:-} ]]; then | ||||||
|   STD="c++11 c++14 c++17" |   STD="c++11 c++14 c++17 c++20" | ||||||
| fi | fi | ||||||
| 
 | 
 | ||||||
| if [[ -z ${COMPILATION_MODE:-} ]]; then | if [[ -z ${COMPILATION_MODE:-} ]]; then | ||||||
|  |  | ||||||
|  | @ -25,7 +25,7 @@ if [[ -z ${ABSEIL_ROOT:-} ]]; then | ||||||
| fi | fi | ||||||
| 
 | 
 | ||||||
| if [[ -z ${STD:-} ]]; then | if [[ -z ${STD:-} ]]; then | ||||||
|   STD="c++11 c++14 c++17" |   STD="c++11 c++14 c++17 c++20" | ||||||
| fi | fi | ||||||
| 
 | 
 | ||||||
| if [[ -z ${COMPILATION_MODE:-} ]]; then | if [[ -z ${COMPILATION_MODE:-} ]]; then | ||||||
|  |  | ||||||
|  | @ -25,7 +25,7 @@ if [[ -z ${ABSEIL_ROOT:-} ]]; then | ||||||
| fi | fi | ||||||
| 
 | 
 | ||||||
| if [[ -z ${STD:-} ]]; then | if [[ -z ${STD:-} ]]; then | ||||||
|   STD="c++11 c++14 c++17" |   STD="c++11 c++14 c++17 c++20" | ||||||
| fi | fi | ||||||
| 
 | 
 | ||||||
| if [[ -z ${COMPILATION_MODE:-} ]]; then | if [[ -z ${COMPILATION_MODE:-} ]]; then | ||||||
|  |  | ||||||
|  | @ -25,7 +25,7 @@ if [[ -z ${ABSEIL_ROOT:-} ]]; then | ||||||
| fi | fi | ||||||
| 
 | 
 | ||||||
| if [[ -z ${STD:-} ]]; then | if [[ -z ${STD:-} ]]; then | ||||||
|   STD="c++11 c++14 c++17" |   STD="c++11 c++14 c++17 c++20" | ||||||
| fi | fi | ||||||
| 
 | 
 | ||||||
| if [[ -z ${COMPILATION_MODE:-} ]]; then | if [[ -z ${COMPILATION_MODE:-} ]]; then | ||||||
|  |  | ||||||
|  | @ -25,7 +25,7 @@ if [[ -z ${ABSEIL_ROOT:-} ]]; then | ||||||
| fi | fi | ||||||
| 
 | 
 | ||||||
| if [[ -z ${STD:-} ]]; then | if [[ -z ${STD:-} ]]; then | ||||||
|   STD="c++11 c++14 c++17" |   STD="c++11 c++14 c++17 c++2a" | ||||||
| fi | fi | ||||||
| 
 | 
 | ||||||
| if [[ -z ${COMPILATION_MODE:-} ]]; then | if [[ -z ${COMPILATION_MODE:-} ]]; then | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue