From 4ce37756306c84263f8097f6d8881beaa7c9629d Mon Sep 17 00:00:00 2001 From: Peter Conrad Date: Tue, 17 Sep 2019 08:06:58 +0200 Subject: [PATCH] Clean up before returning --- src/thread/future.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/thread/future.cpp b/src/thread/future.cpp index 811378c..b4779dd 100644 --- a/src/thread/future.cpp +++ b/src/thread/future.cpp @@ -61,7 +61,11 @@ namespace fc { } _enqueue_thread(); // Need to check _ready again to avoid a race condition. - if( _ready.load() ) return _wait_until( timeout_us ); // this will simply return or throw _exceptp + if( _ready.load() ) + { + _dequeue_thread(); + return _wait_until( timeout_us ); // this will simply return or throw _exceptp + } std::exception_ptr e; //