status-im / nim-chronos

Chronos - An efficient library for asynchronous programming
https://status-im.github.io/nim-chronos/docs/chronos
Apache License 2.0
352 stars 51 forks source link

Ensure that `OwnCancelSchedule` flag will not be removed from wait() and withTimeout(). #519

Closed cheatfate closed 3 months ago

cheatfate commented 3 months ago

I was initially checking OwnCancelSchedule flag being set in this primitives and after test i was agreed that its needed, because otherwise its hard to keep order of execution: wait() and withTimeout() should not be cancelled() first, before future passed as argument will not be completed. So even retFuture become cancelled it should wait until situation with future will not be resolved.