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);