If a unit test times out while generating a private key (e.g. because of
a lack of entropy), this avoids a deadlock by still releasing the read
lock that'd prevent acquiring the write lock when plugins are unloaded.
this->recursive->set(this->recursive, (void*)level + 1);
this->lock->read_lock(this->lock);
+ /* push this in case of a timeout during unit tests */
+ thread_cleanup_push((thread_cleanup_t)this->lock->unlock, this->lock);
enumerator = this->constructors->create_enumerator(this->constructors);
while (enumerator->enumerate(enumerator, &entry))
{
}
}
enumerator->destroy(enumerator);
- this->lock->unlock(this->lock);
+ thread_cleanup_pop(TRUE);
if (!construct && !level)
{