Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

工作线程中clinet读写与主线程关闭client并发执行是否会导致错误 #92

Open
Miyamoto-Konatsu opened this issue Sep 6, 2023 · 1 comment

Comments

@Miyamoto-Konatsu
Copy link

Miyamoto-Konatsu commented Sep 6, 2023

void WebServer::CloseConn_(HttpConn* client) {
    assert(client);
    LOG_INFO("Client[%d] quit!", client->GetFd());
    epoller_->DelFd(client->GetFd());
    client->Close();
}

上面这个函数会因为连接超时而在主线程中执行,如果此时工作线程中正在执行该client的读写任务,岂不是会出问题?

@oo33shan
Copy link

读写操作前不是会延长60s的时间嘛

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants