Fix spurious wake up in dynamic adapter
The predicate version of wait_for() to avoid spurious wake up by checking running_ status. This is a fix to ag/21439870 Test: build widevine Bug: 272424659 Bug: 271811708 Change-Id: I446fef8f4c8c58bcd47b885dba50643b3e5e1185
This commit is contained in:
@@ -532,7 +532,10 @@ class WatchDog {
|
|||||||
{
|
{
|
||||||
std::unique_lock<std::mutex> lock(mutex_);
|
std::unique_lock<std::mutex> lock(mutex_);
|
||||||
if (running_) {
|
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_) {
|
if (running_) {
|
||||||
gave_up_ = true;
|
gave_up_ = true;
|
||||||
@@ -857,7 +860,8 @@ class Adapter {
|
|||||||
for (auto& name : library_names) {
|
for (auto& name : library_names) {
|
||||||
level1_library_ = dlopen((name.c_str()), RTLD_NOW);
|
level1_library_ = dlopen((name.c_str()), RTLD_NOW);
|
||||||
if (!level1_library_) {
|
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_) {
|
if (!level1_library_) {
|
||||||
|
|||||||
Reference in New Issue
Block a user