Reland "Delete unused class GlobalMutex"

This is a reland of commit 5831afb8328cbecdbdbee882280ef907a09d9f31

Original change's description:
> Delete unused class GlobalMutex
>
> Bug: webrtc:13869
> Change-Id: Id3655bdd24630b78e83b606291605a37129fd4bc
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/258131
> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
> Commit-Queue: Niels Moller <nisse@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#36478}

Bug: webrtc:13869
Change-Id: I43f41c9128fc8054fc0051cbeb4dbe5cfc91f458
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/258137
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36491}
This commit is contained in:
Niels Möller
2022-04-07 16:19:15 +02:00
committed by WebRTC LUCI CQ
parent 080006b42f
commit 016ae448e0
4 changed files with 1 additions and 101 deletions

View File

@ -177,30 +177,5 @@ TEST(MutexTest, ProtectsSharedResourceWithMutexAndMutexLocker) {
EXPECT_EQ(0, runner.shared_value());
}
TEST(MutexTest, ProtectsSharedResourceWithGlobalMutexAndRawMutexLocker) {
std::vector<std::unique_ptr<Thread>> threads;
LockRunner<GlobalMutex, RawMutexLocker<GlobalMutex>> runner(absl::kConstInit);
StartThreads(threads, &runner);
runner.SetExpectedThreadCount(kNumThreads);
EXPECT_TRUE(runner.Run());
EXPECT_EQ(0, runner.shared_value());
}
TEST(MutexTest, ProtectsSharedResourceWithGlobalMutexAndMutexLocker) {
std::vector<std::unique_ptr<Thread>> threads;
LockRunner<GlobalMutex, MutexLockLocker<GlobalMutex, GlobalMutexLock>> runner(
absl::kConstInit);
StartThreads(threads, &runner);
runner.SetExpectedThreadCount(kNumThreads);
EXPECT_TRUE(runner.Run());
EXPECT_EQ(0, runner.shared_value());
}
TEST(MutexTest, GlobalMutexCanHaveStaticStorageDuration) {
ABSL_CONST_INIT static GlobalMutex global_lock(absl::kConstInit);
global_lock.Lock();
global_lock.Unlock();
}
} // namespace
} // namespace webrtc