mirror of
https://gitee.com/openharmony/commonlibrary_ets_utils
synced 2024-11-27 09:30:48 +00:00
cherry pick f566486
from https://gitee.com/diartyz/commonlibrary_ets_utils/pulls/1454
Don't change lock's status if there are lock requests in the heldList_. Issue: https://gitee.com/openharmony/commonlibrary_ets_utils/issues/IASLEL Change-Id: I3ad4061d000db4452936b7176a3b9b159e175df2 Signed-off-by: Artem Udovichenko <artem.udovichenko@huawei.com>
This commit is contained in:
parent
d5f601165a
commit
b3f8719a33
@ -65,7 +65,11 @@ void AsyncLock::CleanUpLockRequestOnCompletion(LockRequest* lockRequest)
|
||||
return;
|
||||
}
|
||||
heldList_.erase(it);
|
||||
lockStatus_ = LOCK_MODE_UNLOCK;
|
||||
if (heldList_.empty()) {
|
||||
// There are may be other shared lock requests in the heldList_.
|
||||
// IF so, we mustn't change the status.
|
||||
lockStatus_ = LOCK_MODE_UNLOCK;
|
||||
}
|
||||
napi_env env = lockRequest->GetEnv();
|
||||
delete lockRequest;
|
||||
ProcessPendingLockRequest(env);
|
||||
|
Loading…
Reference in New Issue
Block a user