avoid mixing direct unlocking with lock-holders
Summary: When using lock-holder objects, it is typically required to conduct all unlocking and relocking through them. That way, the RAII lock-holder does not attempt to unlock an unlocked mutex should the code throw after unlocking but before relocking. Changelog: [internal] Reviewed By: sammy-SC Differential Revision: D29238721 fbshipit-source-id: 2403ce8c9e86f96b56a35a456e017486a2854c74
This commit is contained in:
Родитель
7c47420de7
Коммит
77279067f1
|
@ -60,9 +60,9 @@ ComponentDescriptor const &ComponentDescriptorRegistry::at(
|
|||
|
||||
auto it = _registryByName.find(unifiedComponentName);
|
||||
if (it == _registryByName.end()) {
|
||||
mutex_.unlock_shared();
|
||||
lock.unlock();
|
||||
providerRegistry_.request(unifiedComponentName.c_str());
|
||||
mutex_.lock_shared();
|
||||
lock.lock();
|
||||
|
||||
it = _registryByName.find(unifiedComponentName);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче