Skip to content

Commit

Permalink
[core] Made CEpoll::m_EPollLock mutable
Browse files Browse the repository at this point in the history
  • Loading branch information
maxsharabayko committed Mar 31, 2021
1 parent b4288ce commit 26c07c5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion srtcore/epoll.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -808,7 +808,7 @@ int CEPoll::swait(CEPollDesc& d, map<SRTSOCKET, int>& st, int64_t msTimeOut, boo
return 0;
}

bool CEPoll::empty(CEPollDesc& d)
bool CEPoll::empty(const CEPollDesc& d) const
{
ScopedLock lg (m_EPollLock);
return d.watch_empty();
Expand Down
4 changes: 2 additions & 2 deletions srtcore/epoll.h
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ friend class CRendezvousQueue;
int swait(CEPollDesc& d, fmap_t& st, int64_t msTimeOut, bool report_by_exception = true);

/// Empty subscription check - for internal use only.
bool empty(CEPollDesc& d);
bool empty(const CEPollDesc& d) const;

/// Reports which events are ready on the given socket.
/// @param mp socket event map retirned by `swait`
Expand Down Expand Up @@ -486,7 +486,7 @@ friend class CRendezvousQueue;
srt::sync::Mutex m_SeedLock;

std::map<int, CEPollDesc> m_mPolls; // all epolls
srt::sync::Mutex m_EPollLock;
mutable srt::sync::Mutex m_EPollLock;
};

#if ENABLE_HEAVY_LOGGING
Expand Down

0 comments on commit 26c07c5

Please sign in to comment.