Skip to content

Commit b8a2822

Browse files
committed
[core] Made CSndQueue::m_counter atomic.
1 parent 4270a11 commit b8a2822

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

srtcore/queue.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ int srt::CSndQueue::sockoptQuery(int level, int type) const
444444
}
445445

446446
#if ENABLE_LOGGING
447-
int srt::CSndQueue::m_counter = 0;
447+
srt::sync::atomic<int> srt::CSndQueue::m_counter(0);
448448
#endif
449449

450450
void srt::CSndQueue::init(CChannel* c, CTimer* t)

srtcore/queue.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ class CSndQueue
469469
private:
470470

471471
#if ENABLE_LOGGING
472-
static int m_counter;
472+
static srt::sync::atomic<int> m_counter;
473473
#endif
474474

475475
CSndQueue(const CSndQueue&);

srtcore/sync.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,7 @@ class SRT_ATTR_SCOPED_CAPABILITY ExclusiveLock
540540
m_mutex.lock();
541541
}
542542

543-
SRT_ATTR_RELEASE()
543+
SRT_ATTR_RELEASE(m_mutex)
544544
~ExclusiveLock() { m_mutex.unlock(); }
545545

546546
private:

0 commit comments

Comments
 (0)