Loading src/event/kqueue.cpp +16 −9 Changes for src/event/kqueue.cpp: 16 added lines, 9 removed lines. Original line number Diff line number Diff line Loading @@ -225,13 +225,18 @@ namespace netplus { }; void ReadEventHandler(int pos,const int tid,ULONG_PTR args) { con *rcon = reinterpret_cast<con*>(_Events[pos].udata ); buffer buf(BLOCKSIZE); con *rcon = nullptr; if (!rcon || !rcon->csock) { return; { std::lock_guard<std::mutex> global_lock(POLL_HANDLER_MUTEX); rcon = reinterpret_cast<con*>(_Events[pos].udata); if (!rcon || !rcon->csock) { return; } } buffer buf(BLOCKSIZE); std::lock_guard<std::mutex> lock_guard(rcon->event_mutex); if (!rcon || !rcon->csock) { return; } Loading Loading @@ -265,15 +270,17 @@ namespace netplus { }; void WriteEventHandler(int pos,const int tid,ULONG_PTR args) { con *wcon = reinterpret_cast<con*>(_Events[pos].udata); con *wcon = nullptr; if(!wcon || !wcon->csock){ return; } { std::lock_guard<std::mutex> global_lock(POLL_HANDLER_MUTEX); std::lock_guard<std::mutex> lock_guard(wcon->event_mutex); wcon = reinterpret_cast<con*>(_Events[pos].udata); if (!wcon || !wcon->csock) { return; } } std::lock_guard<std::mutex> lock_guard(wcon->event_mutex); try{ evconnection->ResponseEvent(*wcon,tid,args); Loading Loading
src/event/kqueue.cpp +16 −9 Changes for src/event/kqueue.cpp: 16 added lines, 9 removed lines. Original line number Diff line number Diff line Loading @@ -225,13 +225,18 @@ namespace netplus { }; void ReadEventHandler(int pos,const int tid,ULONG_PTR args) { con *rcon = reinterpret_cast<con*>(_Events[pos].udata ); buffer buf(BLOCKSIZE); con *rcon = nullptr; if (!rcon || !rcon->csock) { return; { std::lock_guard<std::mutex> global_lock(POLL_HANDLER_MUTEX); rcon = reinterpret_cast<con*>(_Events[pos].udata); if (!rcon || !rcon->csock) { return; } } buffer buf(BLOCKSIZE); std::lock_guard<std::mutex> lock_guard(rcon->event_mutex); if (!rcon || !rcon->csock) { return; } Loading Loading @@ -265,15 +270,17 @@ namespace netplus { }; void WriteEventHandler(int pos,const int tid,ULONG_PTR args) { con *wcon = reinterpret_cast<con*>(_Events[pos].udata); con *wcon = nullptr; if(!wcon || !wcon->csock){ return; } { std::lock_guard<std::mutex> global_lock(POLL_HANDLER_MUTEX); std::lock_guard<std::mutex> lock_guard(wcon->event_mutex); wcon = reinterpret_cast<con*>(_Events[pos].udata); if (!wcon || !wcon->csock) { return; } } std::lock_guard<std::mutex> lock_guard(wcon->event_mutex); try{ evconnection->ResponseEvent(*wcon,tid,args); Loading