Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions src/channel.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
#include <QThread>
#include <QDateTime>
#include <QFile>
#include <atomic>
#if QT_VERSION >= QT_VERSION_CHECK( 5, 6, 0 )
# include <QVersionNumber>
#endif
Expand Down Expand Up @@ -231,14 +232,14 @@ class CChannel : public QObject
// network protocol
CProtocol Protocol;

int iConTimeOut;
int iConTimeOutStartVal;
int iFadeInCnt;
int iFadeInCntMax;
std::atomic<int> iConTimeOut;
int iConTimeOutStartVal;
int iFadeInCnt;
int iFadeInCntMax;

bool bIsEnabled;
bool bIsServer;
bool bIsIdentified;
std::atomic<bool> bIsEnabled;
bool bIsServer;
bool bIsIdentified;

int iNetwFrameSizeFact;
int iNetwFrameSize;
Expand Down
15 changes: 8 additions & 7 deletions src/client.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
#include <QString>
#include <QDateTime>
#include <QMutex>
#include <atomic>
#ifdef USE_OPUS_SHARED_LIB
# include "opus/opus_custom.h"
#else
Expand Down Expand Up @@ -390,8 +391,8 @@ class CClient : public QObject
EAudChanConf eAudioChannelConf;
int iNumAudioChannels;
bool bIsInitializationPhase;
bool bMuteOutStream;
float fMuteOutStreamGain;
std::atomic<bool> bMuteOutStream;
std::atomic<float> fMuteOutStreamGain;
CVector<unsigned char> vecCeltData;

bool bIPv6Available; // must be before Socket - passed by reference to Socket
Expand All @@ -402,11 +403,11 @@ class CClient : public QObject

CVector<uint8_t> vecbyNetwData;

int iAudioInFader;
bool bReverbOnLeftChan;
int iReverbLevel;
CAudioReverb AudioReverb;
int iInputBoost;
std::atomic<int> iAudioInFader;
std::atomic<bool> bReverbOnLeftChan;
std::atomic<int> iReverbLevel;
CAudioReverb AudioReverb;
std::atomic<int> iInputBoost;

int iSndCrdPrefFrameSizeFactor;
int iSndCrdFrameSizeFactor;
Expand Down
6 changes: 3 additions & 3 deletions src/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -944,9 +944,9 @@ void CServer::DecodeReceiveData ( const int iChanCnt, const int iNumClients )

FreeChannel ( iCurChanID ); // note that the channel is now not in use

// note that no mutex is needed for this shared resource since it is not a
// read-modify-write operation but an atomic write and also each thread can
// only set it to true and never to false
// note that no mutex is needed for this shared resource since it is a
// std::atomic write (not a read-modify-write operation) and also each
// thread can only set it to true and never to false
bChannelIsNowDisconnected = true;

// since the channel is no longer in use, we should return
Expand Down
9 changes: 5 additions & 4 deletions src/server.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
#include <QHostAddress>
#include <QFileInfo>
#include <algorithm>
#include <atomic>
#ifdef USE_OPUS_SHARED_LIB
# include "opus/opus_custom.h"
#else
Expand Down Expand Up @@ -254,10 +255,10 @@ class CServer : public QObject, public CServerSlots<MAX_NUM_CHANNELS>
int vecChannelOrder[MAX_NUM_CHANNELS];
QMutex MutexChanOrder;

CProtocol ConnLessProtocol;
QMutex Mutex;
QMutex MutexWelcomeMessage;
bool bChannelIsNowDisconnected;
CProtocol ConnLessProtocol;
QMutex Mutex;
QMutex MutexWelcomeMessage;
std::atomic<bool> bChannelIsNowDisconnected;

// audio encoder/decoder
OpusCustomMode* Opus64Mode[MAX_NUM_CHANNELS];
Expand Down
Loading