Migrate rtc_tools/, sdk/, and system_wrappers/ to webrtc::Mutex.
Bug: webrtc:11567 Change-Id: Ia85cf457ac16ebec0a70d319506415e4dec46f30 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/178903 Reviewed-by: Magnus Flodman <mflodman@webrtc.org> Commit-Queue: Markus Handell <handellm@webrtc.org> Cr-Commit-Position: refs/heads/master@{#31693}
This commit is contained in:
committed by
Commit Bot
parent
e6f3897945
commit
85585f4a52
@ -16,12 +16,12 @@
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
#include "rtc_base/critical_section.h"
|
||||
#include "rtc_base/event.h"
|
||||
#include "rtc_base/logging.h"
|
||||
#include "rtc_base/platform_thread.h"
|
||||
#include "rtc_base/string_utils.h"
|
||||
#include "rtc_base/strings/string_builder.h"
|
||||
#include "rtc_base/synchronization/mutex.h"
|
||||
#include "rtc_base/system/inline.h"
|
||||
#include "system_wrappers/include/sleep.h"
|
||||
#include "test/gtest.h"
|
||||
@ -118,15 +118,15 @@ class RtcEventDeadlock : public DeadlockInterface {
|
||||
class RtcCriticalSectionDeadlock : public DeadlockInterface {
|
||||
public:
|
||||
RtcCriticalSectionDeadlock()
|
||||
: critscope_(std::make_unique<rtc::CritScope>(&crit_)) {}
|
||||
: mutex_lock_(std::make_unique<MutexLock>(&mutex_)) {}
|
||||
|
||||
private:
|
||||
void Deadlock() override { rtc::CritScope lock(&crit_); }
|
||||
void Deadlock() override { MutexLock lock(&mutex_); }
|
||||
|
||||
void Release() override { critscope_.reset(); }
|
||||
void Release() override { mutex_lock_.reset(); }
|
||||
|
||||
rtc::CriticalSection crit_;
|
||||
std::unique_ptr<rtc::CritScope> critscope_;
|
||||
Mutex mutex_;
|
||||
std::unique_ptr<MutexLock> mutex_lock_;
|
||||
};
|
||||
|
||||
class SpinDeadlock : public DeadlockInterface {
|
||||
|
||||
Reference in New Issue
Block a user