From 13f0655cba19f38dd4198988923732c99847eee3 Mon Sep 17 00:00:00 2001 From: heinrich5991 Date: Thu, 12 Oct 2017 00:53:12 +0200 Subject: [PATCH] Don't reset `ASYNCIO_CLOSE` flag on `async_wait` --- src/base/system.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/base/system.c b/src/base/system.c index 832b7c760..9b29e2f6c 100644 --- a/src/base/system.c +++ b/src/base/system.c @@ -728,7 +728,10 @@ void async_wait(ASYNCIO *aio) lock_wait(aio->lock); thread = aio->thread; aio->thread = 0; - aio->finish = ASYNCIO_EXIT; + if(aio->finish == ASYNCIO_RUNNING) + { + aio->finish = ASYNCIO_EXIT; + } lock_unlock(aio->lock); sphore_signal(&aio->sphore); thread_wait(thread);