Skip to content

Commit

Permalink
Merge pull request #418 from vibe-d/task_join_assertion
Browse files Browse the repository at this point in the history
Add assertion to avoid deadlocks in Task.join
  • Loading branch information
s-ludwig authored Nov 23, 2024
2 parents 038f388 + 5b06321 commit 20e3193
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions source/vibe/core/task.d
Original file line number Diff line number Diff line change
Expand Up @@ -603,6 +603,9 @@ final package class TaskFiber : Fiber {
auto st = getTaskStatus();
if (!st.initialized || st.counter != task_counter)
break;

assert(cast(shared(TaskFiber))Fiber.getThis() !is this, "Task attempting to join itself");

static if (interruptiple)
cnt = m_onExit.wait(cnt);
else
Expand Down

0 comments on commit 20e3193

Please sign in to comment.