Revert "Update to handle spurious wake up in conditional variable"
This reverts commit 75eef5c3a3.
Reason for revert: Temporarily revert this because of b/272424659, b/259697096, while we are discussing another fix ag/21942341
Change-Id: Ib6a7e9cbede2a818433e67315affc60607146d55
This commit is contained in:
committed by
Android (Google) Code Review
parent
75eef5c3a3
commit
646a1eece5
@@ -44,12 +44,6 @@ using video_widevine::ProvisioningResponse;
|
|||||||
using wvcdm::kLevel3;
|
using wvcdm::kLevel3;
|
||||||
using wvcdm::kLevelDefault;
|
using wvcdm::kLevelDefault;
|
||||||
using namespace std;
|
using namespace std;
|
||||||
using namespace std::chrono;
|
|
||||||
|
|
||||||
#define GET_TIME() \
|
|
||||||
((duration_cast<milliseconds>(system_clock::now().time_since_epoch())) \
|
|
||||||
.count())
|
|
||||||
#define TIMEOUT_IN_MILLISECONDS 2 * 60 * 1000 // 2 minutes
|
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
@@ -534,16 +528,7 @@ class WatchDog {
|
|||||||
{
|
{
|
||||||
std::unique_lock<std::mutex> lock(mutex_);
|
std::unique_lock<std::mutex> lock(mutex_);
|
||||||
if (running_) {
|
if (running_) {
|
||||||
bool waitStatus = false;
|
condition_.wait_for(lock, std::chrono::minutes(2));
|
||||||
time_t time = GET_TIME();
|
|
||||||
do {
|
|
||||||
waitStatus = condition_.wait_for(
|
|
||||||
lock, std::chrono::milliseconds(TIMEOUT_IN_MILLISECONDS),
|
|
||||||
[time, this]() {
|
|
||||||
return ((GET_TIME() > time + TIMEOUT_IN_MILLISECONDS) |
|
|
||||||
(!running_));
|
|
||||||
});
|
|
||||||
} while (waitStatus != true);
|
|
||||||
}
|
}
|
||||||
if (running_) {
|
if (running_) {
|
||||||
gave_up_ = true;
|
gave_up_ = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user