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:
Cong Lin
2023-03-09 23:58:38 +00:00
committed by Android (Google) Code Review
parent 75eef5c3a3
commit 646a1eece5

View File

@@ -44,12 +44,6 @@ using video_widevine::ProvisioningResponse;
using wvcdm::kLevel3;
using wvcdm::kLevelDefault;
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 {
@@ -534,16 +528,7 @@ class WatchDog {
{
std::unique_lock<std::mutex> lock(mutex_);
if (running_) {
bool waitStatus = false;
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);
condition_.wait_for(lock, std::chrono::minutes(2));
}
if (running_) {
gave_up_ = true;