Loading src/connection.h +1 −1 Changes for src/connection.h: 1 added line, 1 removed line. Original line number Diff line number Diff line Loading @@ -166,7 +166,7 @@ namespace netplus { condata<char> RecvData; condata<char> SendData; std::recursive_mutex event_mutex; std::mutex event_mutex; protected: con(); time_t lasteventime; Loading src/event/epoll.cpp +6 −3 Changes for src/event/epoll.cpp: 6 added lines, 3 removed lines. Original line number Diff line number Diff line Loading @@ -59,6 +59,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. namespace netplus { bool RUNNING=true; std::mutex CLOSE_HANDLER_MUTEX; void signalHandler(int signum) { switch(signum){ Loading Loading @@ -220,7 +221,7 @@ namespace netplus { return; } std::unique_lock<std::recursive_mutex> lock(rcon->event_mutex, std::defer_lock); std::unique_lock<std::mutex> lock(rcon->event_mutex, std::defer_lock); if (!rcon->csock) { return; } Loading Loading @@ -255,7 +256,7 @@ namespace netplus { void WriteEventHandler(int pos,const int tid,ULONG_PTR args) { con *wcon = reinterpret_cast<con*>(_Events[pos].data.ptr); std::unique_lock<std::recursive_mutex> lock(wcon->event_mutex, std::defer_lock); std::unique_lock<std::mutex> lock(wcon->event_mutex, std::defer_lock); if (!wcon->csock) { return; } Loading Loading @@ -295,6 +296,8 @@ namespace netplus { void CloseEventHandler(int pos,const int tid,ULONG_PTR args) { std::lock_guard<std::mutex> global_lock(CLOSE_HANDLER_MUTEX); if (!_Events[pos].data.ptr) { return; } Loading @@ -302,7 +305,7 @@ void CloseEventHandler(int pos,const int tid,ULONG_PTR args) { con *ccon = reinterpret_cast<con*>(_Events[pos].data.ptr); { std::lock_guard<std::recursive_mutex> lock(ccon->event_mutex); std::lock_guard<std::mutex> lock(ccon->event_mutex); if (ccon->csock) { try { Loading src/event/kqueue.cpp +3 −5 Changes for src/event/kqueue.cpp: 3 added lines, 5 removed lines. Original line number Diff line number Diff line Loading @@ -144,8 +144,6 @@ namespace netplus { if(!curcon) return; std::lock_guard<std::recursive_mutex> lock(curcon->event_mutex); if(!curcon->csock) return; EV_SET(&setevent,curcon->csock->fd(),filter,events,0,0,curcon); Loading Loading @@ -234,7 +232,7 @@ namespace netplus { return; } std::lock_guard<std::recursive_mutex> lock(rcon->event_mutex); std::lock_guard<std::mutex> lock(rcon->event_mutex); if (!rcon->csock) { return; } Loading Loading @@ -278,7 +276,7 @@ namespace netplus { return; } std::lock_guard<std::recursive_mutex> lock(wcon->event_mutex); std::lock_guard<std::mutex> lock(wcon->event_mutex); if (!wcon->csock) { return; } Loading Loading @@ -336,7 +334,7 @@ namespace netplus { } { std::lock_guard<std::recursive_mutex> lock(ccon->event_mutex); std::lock_guard<std::mutex> lock(ccon->event_mutex); _Events[pos].udata = nullptr; // Clear the pointer } Loading Loading
src/connection.h +1 −1 Changes for src/connection.h: 1 added line, 1 removed line. Original line number Diff line number Diff line Loading @@ -166,7 +166,7 @@ namespace netplus { condata<char> RecvData; condata<char> SendData; std::recursive_mutex event_mutex; std::mutex event_mutex; protected: con(); time_t lasteventime; Loading
src/event/epoll.cpp +6 −3 Changes for src/event/epoll.cpp: 6 added lines, 3 removed lines. Original line number Diff line number Diff line Loading @@ -59,6 +59,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. namespace netplus { bool RUNNING=true; std::mutex CLOSE_HANDLER_MUTEX; void signalHandler(int signum) { switch(signum){ Loading Loading @@ -220,7 +221,7 @@ namespace netplus { return; } std::unique_lock<std::recursive_mutex> lock(rcon->event_mutex, std::defer_lock); std::unique_lock<std::mutex> lock(rcon->event_mutex, std::defer_lock); if (!rcon->csock) { return; } Loading Loading @@ -255,7 +256,7 @@ namespace netplus { void WriteEventHandler(int pos,const int tid,ULONG_PTR args) { con *wcon = reinterpret_cast<con*>(_Events[pos].data.ptr); std::unique_lock<std::recursive_mutex> lock(wcon->event_mutex, std::defer_lock); std::unique_lock<std::mutex> lock(wcon->event_mutex, std::defer_lock); if (!wcon->csock) { return; } Loading Loading @@ -295,6 +296,8 @@ namespace netplus { void CloseEventHandler(int pos,const int tid,ULONG_PTR args) { std::lock_guard<std::mutex> global_lock(CLOSE_HANDLER_MUTEX); if (!_Events[pos].data.ptr) { return; } Loading @@ -302,7 +305,7 @@ void CloseEventHandler(int pos,const int tid,ULONG_PTR args) { con *ccon = reinterpret_cast<con*>(_Events[pos].data.ptr); { std::lock_guard<std::recursive_mutex> lock(ccon->event_mutex); std::lock_guard<std::mutex> lock(ccon->event_mutex); if (ccon->csock) { try { Loading
src/event/kqueue.cpp +3 −5 Changes for src/event/kqueue.cpp: 3 added lines, 5 removed lines. Original line number Diff line number Diff line Loading @@ -144,8 +144,6 @@ namespace netplus { if(!curcon) return; std::lock_guard<std::recursive_mutex> lock(curcon->event_mutex); if(!curcon->csock) return; EV_SET(&setevent,curcon->csock->fd(),filter,events,0,0,curcon); Loading Loading @@ -234,7 +232,7 @@ namespace netplus { return; } std::lock_guard<std::recursive_mutex> lock(rcon->event_mutex); std::lock_guard<std::mutex> lock(rcon->event_mutex); if (!rcon->csock) { return; } Loading Loading @@ -278,7 +276,7 @@ namespace netplus { return; } std::lock_guard<std::recursive_mutex> lock(wcon->event_mutex); std::lock_guard<std::mutex> lock(wcon->event_mutex); if (!wcon->csock) { return; } Loading Loading @@ -336,7 +334,7 @@ namespace netplus { } { std::lock_guard<std::recursive_mutex> lock(ccon->event_mutex); std::lock_guard<std::mutex> lock(ccon->event_mutex); _Events[pos].udata = nullptr; // Clear the pointer } Loading