diff options
author | Dmitry Vyukov <dvyukov@google.com> | 2023-10-27 06:34:24 -0700 |
---|---|---|
committer | Copybara-Service <copybara-worker@google.com> | 2023-10-27 06:35:17 -0700 |
commit | 89d2caa104563ad8c2182282f5d4676f6747bd0e (patch) | |
tree | 6459f3877e4aa1ab75946529cfafcafe4f02f966 /absl/synchronization/mutex_test.cc | |
parent | cdb1e7f4a60a6d0ee038f733776356a50121265a (diff) |
Rollback "Mutex: Remove destructor in release build"
PiperOrigin-RevId: 577180526
Change-Id: Iec53709456805ca8dc5327669cc0f6c95825d0e9
Diffstat (limited to 'absl/synchronization/mutex_test.cc')
-rw-r--r-- | absl/synchronization/mutex_test.cc | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/absl/synchronization/mutex_test.cc b/absl/synchronization/mutex_test.cc index 35b43334..6c38c07c 100644 --- a/absl/synchronization/mutex_test.cc +++ b/absl/synchronization/mutex_test.cc @@ -1709,33 +1709,6 @@ TEST(Mutex, Logging) { logged_cv.SignalAll(); } -TEST(Mutex, LoggingAddressReuse) { - // Repeatedly re-create a Mutex with debug logging at the same address. - alignas(absl::Mutex) char storage[sizeof(absl::Mutex)]; - auto invariant = - +[](void *alive) { EXPECT_TRUE(*static_cast<bool *>(alive)); }; - constexpr size_t kIters = 10; - bool alive[kIters] = {}; - for (size_t i = 0; i < kIters; ++i) { - absl::Mutex *mu = new (storage) absl::Mutex; - alive[i] = true; - mu->EnableDebugLog("Mutex"); - mu->EnableInvariantDebugging(invariant, &alive[i]); - mu->Lock(); - mu->Unlock(); - mu->~Mutex(); - alive[i] = false; - } -} - -TEST(Mutex, LoggingBankrupcy) { - // Test the case with too many live Mutexes with debug logging. - std::vector<absl::Mutex> mus(1 << 20); - for (auto &mu : mus) { - mu.EnableDebugLog("Mutex"); - } -} - // -------------------------------------------------------- // Generate the vector of thread counts for tests parameterized on thread count. |