Skip to content

Commit

Permalink
Add assertion to avoid deadlocks in Task.join.
Browse files Browse the repository at this point in the history
  • Loading branch information
s-ludwig committed Nov 23, 2024
1 parent 038f388 commit 9b82476
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions source/vibe/core/task.d
Original file line number Diff line number Diff line change
Expand Up @@ -598,6 +598,8 @@ final package class TaskFiber : Fiber {
*/
void join(bool interruptiple)(size_t task_counter)
shared @trusted {
assert(cast(shared(TaskFiber))Fiber.getThis() !is this, "Task attempting to join itself");

auto cnt = m_onExit.emitCount;
while (true) {
auto st = getTaskStatus();
Expand Down

0 comments on commit 9b82476

Please sign in to comment.