fix: deadlock in IO.Promise.resolve (#3693)

This commit is contained in:
Sebastian Ullrich 2024-03-20 13:47:52 +01:00 committed by GitHub
parent 3ab1c23500
commit afbf8759e1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -788,6 +788,7 @@ public:
void resolve(lean_task_object * t, object * v) {
unique_lock<mutex> lock(m_mutex);
if (t->m_value) {
lock.unlock(); // `dec(v)` could lead to `deactivate_task` trying to take the lock
dec(v);
return;
}