Commit a58d6579 authored by jan.koester's avatar jan.koester
Browse files

test

parent 67cf5596
Loading
Loading
Loading
Loading
+1 −1
Changes for src/connection.h: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -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;
+6 −3
Changes for src/event/epoll.cpp: 6 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -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){
@@ -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; }

@@ -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; }

@@ -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;
    }
@@ -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 {
+3 −5
Changes for src/event/kqueue.cpp: 3 added lines, 5 removed lines.
Original line number Diff line number Diff line
@@ -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);
@@ -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; }

@@ -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; }

@@ -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
             }