Fix spurious wake up in dynamic adapter am: 5ccb147bb8 am: dbb3775757

Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/22686796

Change-Id: Iafbda7d19396a6afebfb198ea2199dc290c02a46
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Cong Lin
2023-04-20 23:05:13 +00:00
committed by Automerger Merge Worker

View File

@@ -532,7 +532,10 @@ class WatchDog {
{
std::unique_lock<std::mutex> lock(mutex_);
if (running_) {
condition_.wait_for(lock, std::chrono::minutes(2));
if (!condition_.wait_for(lock, std::chrono::minutes(2),
[this]() { return !running_; })) {
LOGE("Level3 initialization timed out");
}
}
if (running_) {
gave_up_ = true;
@@ -857,7 +860,8 @@ class Adapter {
for (auto& name : library_names) {
level1_library_ = dlopen((name.c_str()), RTLD_NOW);
if (!level1_library_) {
LOGW("Could not load oemcrypto from path %s. %s", name.c_str(), dlerror());
LOGW("Could not load oemcrypto from path %s. %s", name.c_str(),
dlerror());
}
}
if (!level1_library_) {