From 646a1eece59a67df78c1aa18dbd4ffbc76956218 Mon Sep 17 00:00:00 2001 From: Cong Lin Date: Thu, 9 Mar 2023 23:58:38 +0000 Subject: [PATCH] Revert "Update to handle spurious wake up in conditional variable" This reverts commit 75eef5c3a3e2bcbc003b697fc2b6c1de0f842005. Reason for revert: Temporarily revert this because of b/272424659, b/259697096, while we are discussing another fix ag/21942341 Change-Id: Ib6a7e9cbede2a818433e67315affc60607146d55 --- .../cdm/core/src/oemcrypto_adapter_dynamic.cpp | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/libwvdrmengine/cdm/core/src/oemcrypto_adapter_dynamic.cpp b/libwvdrmengine/cdm/core/src/oemcrypto_adapter_dynamic.cpp index f37d8579..d674fc61 100644 --- a/libwvdrmengine/cdm/core/src/oemcrypto_adapter_dynamic.cpp +++ b/libwvdrmengine/cdm/core/src/oemcrypto_adapter_dynamic.cpp @@ -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(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 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;