Commit 14c939da authored by jan.koester's avatar jan.koester
Browse files

some fixes

parent 68f2a53e
Loading
Loading
Loading
Loading
+6 −1
Changes for src/linux/event.cpp: 6 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -225,7 +225,8 @@ namespace netplus {
            throw except;
        }

        _lockCon(delcon);
        if(!_trylockCon(delcon))
            return;

        int ect = epoll_ctl(_pollFD, EPOLL_CTL_DEL,
            delcon->csock->getSocket(), 0);
@@ -266,17 +267,21 @@ namespace netplus {

    void poll::_lockCon(con *curcon){
        const std::lock_guard<std::mutex> lock(_StateLock);
        if(curcon)
            return curcon->conlock.lock();
    }

    void poll::_unlockCon(con *curcon){
        const std::lock_guard<std::mutex> lock(_StateLock);
        if(curcon)
            return curcon->conlock.unlock();
    }

    bool poll::_trylockCon(con *curcon){
        const std::lock_guard<std::mutex> lock(_StateLock);
        if(curcon)
            return curcon->conlock.try_lock();
        return false;
    }

    bool event::_Run = true;