Fix safe stop procedure

This commit is contained in:
Vitaliy Filippov
2019-11-28 02:27:17 +03:00
parent d56cb290ee
commit e1ac4dba23
5 changed files with 26 additions and 10 deletions
+9 -2
View File
@@ -89,12 +89,19 @@ static void bs_cleanup(struct thread_data *td)
bs_data *bsd = (bs_data*)td->io_ops_data;
if (bsd)
{
while (!bsd->bs->is_safe_to_stop())
while (1)
{
bsd->ringloop->loop();
do
{
bsd->ringloop->loop();
if (bsd->bs->is_safe_to_stop())
goto safe;
} while (bsd->ringloop->loop_again);
bsd->ringloop->wait();
}
safe:
delete bsd->bs;
delete bsd->ringloop;
delete bsd;
}
}