提交 2448d4b4 编写于 作者: O openeuler-ci-bot 提交者: Gitee

!428 fix shim io copy lost msgs problem occasionally

Merge pull request !428 from gaohuatao/mst
......@@ -243,7 +243,7 @@ static void* task_io_copy(void *data)
for (;;) {
memset(buf, 0, DEFAULT_IO_COPY_BUF);
sem_wait(&(io_thd->sem_thd));
if (io_thd->shutdown) {
if (io_thd->is_stdin && io_thd->shutdown) {
break;
}
......@@ -272,6 +272,10 @@ static void* task_io_copy(void *data)
}
}
}
if (io_thd->shutdown) {
break;
}
}
struct epoll_event ev;
ev.events = EPOLLIN;
......@@ -328,6 +332,7 @@ static int process_io_start(process_t *p, int std_id)
io_thd->epfd = p->io_loop_fd;
io_thd->ioc = ioc;
io_thd->shutdown = false;
io_thd->is_stdin = std_id == stdid_in ? true : false;
io_thd->terminal = std_id != stdid_in ? p->terminal : NULL;
p->io_threads[std_id] = io_thd;
......
......@@ -58,6 +58,7 @@ typedef struct {
sem_t sem_thd;
io_copy_t *ioc;
bool shutdown;
bool is_stdin;
log_terminal *terminal;
} io_thread_t;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册