mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2024-11-26 21:58:37 -05:00
This lock is actually needed, restore it.
This commit is contained in:
parent
3c3939e0b7
commit
b52c4ac8a6
@ -83,6 +83,8 @@ DemodulatorInstance::DemodulatorInstance() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
DemodulatorInstance::~DemodulatorInstance() {
|
DemodulatorInstance::~DemodulatorInstance() {
|
||||||
|
|
||||||
|
std::lock_guard < std::recursive_mutex > lockData(m_thread_control_mutex);
|
||||||
|
|
||||||
//now that DemodulatorInstance are managed through shared_ptr, we
|
//now that DemodulatorInstance are managed through shared_ptr, we
|
||||||
//should enter here ONLY when it is no longer used by any piece of code, anywhere.
|
//should enter here ONLY when it is no longer used by any piece of code, anywhere.
|
||||||
@ -120,6 +122,8 @@ void DemodulatorInstance::setVisualOutputQueue(DemodulatorThreadOutputQueuePtr t
|
|||||||
|
|
||||||
void DemodulatorInstance::run() {
|
void DemodulatorInstance::run() {
|
||||||
|
|
||||||
|
std::lock_guard < std::recursive_mutex > lockData(m_thread_control_mutex);
|
||||||
|
|
||||||
if (active) {
|
if (active) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -187,6 +191,8 @@ void DemodulatorInstance::setLabel(std::string labelStr) {
|
|||||||
|
|
||||||
bool DemodulatorInstance::isTerminated() {
|
bool DemodulatorInstance::isTerminated() {
|
||||||
|
|
||||||
|
std::lock_guard < std::recursive_mutex > lockData(m_thread_control_mutex);
|
||||||
|
|
||||||
bool audioTerminated = audioThread->isTerminated();
|
bool audioTerminated = audioThread->isTerminated();
|
||||||
bool demodTerminated = demodulatorThread->isTerminated();
|
bool demodTerminated = demodulatorThread->isTerminated();
|
||||||
bool preDemodTerminated = demodulatorPreThread->isTerminated();
|
bool preDemodTerminated = demodulatorPreThread->isTerminated();
|
||||||
|
@ -139,6 +139,9 @@ private:
|
|||||||
DemodulatorThread *demodulatorThread;
|
DemodulatorThread *demodulatorThread;
|
||||||
DemodulatorThreadControlCommandQueuePtr threadQueueControl;
|
DemodulatorThreadControlCommandQueuePtr threadQueueControl;
|
||||||
|
|
||||||
|
//protects child thread creation and termination
|
||||||
|
std::recursive_mutex m_thread_control_mutex;
|
||||||
|
|
||||||
std::atomic<std::string *> label; //
|
std::atomic<std::string *> label; //
|
||||||
// User editable buffer, 16 bit string.
|
// User editable buffer, 16 bit string.
|
||||||
std::atomic<std::wstring *> user_label;
|
std::atomic<std::wstring *> user_label;
|
||||||
|
Loading…
Reference in New Issue
Block a user