Skip to content

Commit

Permalink
[core] Made CSndQueue::m_counter atomic.
Browse files Browse the repository at this point in the history
  • Loading branch information
maxsharabayko committed Aug 8, 2024
1 parent 4270a11 commit b8a2822
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion srtcore/queue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ int srt::CSndQueue::sockoptQuery(int level, int type) const
}

#if ENABLE_LOGGING
int srt::CSndQueue::m_counter = 0;
srt::sync::atomic<int> srt::CSndQueue::m_counter(0);
#endif

void srt::CSndQueue::init(CChannel* c, CTimer* t)
Expand Down
2 changes: 1 addition & 1 deletion srtcore/queue.h
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ class CSndQueue
private:

#if ENABLE_LOGGING
static int m_counter;
static srt::sync::atomic<int> m_counter;
#endif

CSndQueue(const CSndQueue&);
Expand Down
2 changes: 1 addition & 1 deletion srtcore/sync.h
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ class SRT_ATTR_SCOPED_CAPABILITY ExclusiveLock
m_mutex.lock();
}

SRT_ATTR_RELEASE()
SRT_ATTR_RELEASE(m_mutex)
~ExclusiveLock() { m_mutex.unlock(); }

private:
Expand Down

0 comments on commit b8a2822

Please sign in to comment.