mirror of
https://github.com/status-im/nim-chronos.git
synced 2025-01-31 13:35:11 +00:00
fix: avoid completing future twise
This commit is contained in:
parent
c39c069680
commit
546cc36d79
@ -855,7 +855,7 @@ proc wait*[T](fut: Future[T], timeout = InfiniteDuration): Future[T] =
|
|||||||
|
|
||||||
proc continuation(udata: pointer) {.gcsafe.} =
|
proc continuation(udata: pointer) {.gcsafe.} =
|
||||||
if not(retFuture.finished()):
|
if not(retFuture.finished()):
|
||||||
if isNil(udata):
|
if not(fut.finished()):
|
||||||
# Timer exceeded first.
|
# Timer exceeded first.
|
||||||
fut.removeCallback(continuation)
|
fut.removeCallback(continuation)
|
||||||
fut.cancel()
|
fut.cancel()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user