| 292 | } |
| 293 | |
| 294 | void aio_wait(ASYNCIO *aio) |
| 295 | { |
| 296 | void *thread; |
| 297 | { |
| 298 | CLockScope ls(aio->lock); |
| 299 | thread = aio->thread; |
| 300 | aio->thread = nullptr; |
| 301 | if(aio->finish == ASYNCIO_RUNNING) |
| 302 | { |
| 303 | aio->finish = ASYNCIO_EXIT; |
| 304 | } |
| 305 | } |
| 306 | sphore_signal(&aio->sphore); |
| 307 | thread_wait(thread); |
| 308 | } |
| 309 | |
| 310 | void aio_free(ASYNCIO *aio) |
| 311 | { |