Lyricdev
GitHub

LYR-RT0018

a deadlock

panic · spec 10-concurrency

Every task of a thread waits — for a channel, a lock, another task — and nothing can wake one: no task is ready, none sleeps, no other thread lives. The wait panics in the waiting task.

Program

import std.task { Channel };

fn main(): void {
    let ch = Channel<int>.new();
    let v = try ch.recv();
    assert(v == 0);
}