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

test

parent e8ad0ab5
Loading
Loading
Loading
Loading
+11 −4
Changes for src/event/epoll.cpp: 11 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -220,7 +220,9 @@ namespace netplus {
                return;
            }

            std::unique_lock<std::mutex> lock(rcon->event_mutex, std::defer_lock);
            std::unique_lock<std::recursive_mutex> lock(rcon->event_mutex, std::defer_lock);

            if (!rcon->csock) { return; }

            try{

@@ -253,6 +255,10 @@ 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);

            if (!wcon->csock) { return; }

            try{
                evconnection->ResponseEvent(*wcon,tid,args);

@@ -289,14 +295,16 @@ namespace netplus {


        void CloseEventHandler(int pos,const int tid,ULONG_PTR args) {
            std::lock_guard<std::mutex> lock(_pollMutex);

            if (!_Events[pos].data.ptr) {
                return;
            }

            con *ccon =  reinterpret_cast<con*>(_Events[pos].data.ptr);

            std::lock_guard<std::recursive_mutex> lock(ccon->event_mutex);



            try{
                if(_pollFD!=pos){
                    if(epoll_ctl(_pollFD, EPOLL_CTL_DEL,ccon->csock->fd(), nullptr)<0){
@@ -317,7 +325,6 @@ namespace netplus {
        };

    private:
        std::mutex                                             _pollMutex;
        int                                                           _pollFD;
        std::unique_ptr<struct epoll_event[]> _Events;
        socket*                                                   _ServerSocket;
+4 −3
Changes for src/event/kqueue.cpp: 4 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -227,7 +227,7 @@ namespace netplus {
                return;
            }

            std::lock_guard<std::mutex> lock(rcon->event_mutex);
            std::lock_guard<std::recursive_mutex> lock(rcon->event_mutex);

            if (!rcon->csock) { return; }

@@ -271,7 +271,7 @@ namespace netplus {
                return;
            }

            std::lock_guard<std::mutex> lock(wcon->event_mutex);
            std::lock_guard<std::recursive_mutex> lock(wcon->event_mutex);

            if (!wcon->csock) { return; }

@@ -326,8 +326,9 @@ namespace netplus {
                return;
            }

            std::lock_guard<std::mutex> lock(ccon->event_mutex);
            std::lock_guard<std::recursive_mutex> lock(ccon->event_mutex);

            if (!ccon->csock) { return; }

            if (ccon->csock) {
                setpollEvents(ccon, EVFILT_READ | EVFILT_WRITE, EV_DELETE);