Closed etan-status closed 3 months ago
this leads to deadlock:
import chronos proc f(): Future[void] {.async.} = await sleepAsync(10.seconds) or sleepAsync(5.seconds) proc g(): Future[void] {.async.} = let fx = f() await fx.cancelAndWait() waitFor g() echo "ok"
this works fine:
import chronos proc f(): Future[void] {.async.} = discard await race(sleepAsync(10.seconds), sleepAsync(5.seconds)) proc g(): Future[void] {.async.} = let fx = f() await fx.cancelAndWait() waitFor g() echo "ok"
this leads to deadlock:
this works fine: