sf_binlog_writer_finish check thread running

vote_node V1.1.14
YuQing 2022-04-24 10:57:19 +08:00
parent dcd024019b
commit 3734e68e0b
1 changed files with 7 additions and 3 deletions

View File

@ -267,13 +267,17 @@ void sf_binlog_writer_finish(SFBinlogWriterInfo *writer)
int count; int count;
if (writer->fw.file.name != NULL) { if (writer->fw.file.name != NULL) {
while (!fc_queue_empty(&writer->thread->queue)) { while (writer->thread->running && !fc_queue_empty(
&writer->thread->queue))
{
fc_sleep_ms(10); fc_sleep_ms(10);
} }
sf_binlog_writer_notify_exit(writer); if (writer->thread->running) {
sf_binlog_writer_notify_exit(writer);
}
count = 0; count = 0;
while (writer->thread->running && ++count < 300) { while (writer->thread->running && ++count < 500) {
fc_sleep_ms(10); fc_sleep_ms(10);
} }