markparticle/WebServer

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

Opened this issue · 1 comments

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

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

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