Skip to content

Commit

Permalink
fix: deadlock in IO.Promise.resolve (#3693)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kha authored Mar 20, 2024
1 parent 3ab1c23 commit afbf875
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/runtime/object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -788,6 +788,7 @@ class task_manager {
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;
}
Expand Down

0 comments on commit afbf875

Please sign in to comment.