From 1d950f31ba671aa874c41216cc700b9d9f76d893 Mon Sep 17 00:00:00 2001 From: Thulinma Date: Sat, 28 May 2016 13:45:19 +0200 Subject: [PATCH] Fix controller deadlock. --- src/controller/controller_statistics.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/controller/controller_statistics.cpp b/src/controller/controller_statistics.cpp index f284290e..af9f8fcb 100644 --- a/src/controller/controller_statistics.cpp +++ b/src/controller/controller_statistics.cpp @@ -126,7 +126,6 @@ void Controller::killStatistics(char * data, size_t len, unsigned int id){ ///This function is ran whenever a stream becomes active. void Controller::streamStarted(std::string stream){ - tthread::lock_guard guard(Controller::configMutex); INFO_MSG("Stream %s became active", stream.c_str()); Controller::doAutoPush(stream); } @@ -177,7 +176,8 @@ void Controller::SharedMemStats(void * config){ std::set inactiveStreams; while(((Util::Config*)config)->is_active){ { - tthread::lock_guard guard(statsMutex); + tthread::lock_guard guard(Controller::configMutex); + tthread::lock_guard guard2(statsMutex); //parse current users statServer.parseEach(parseStatistics); //wipe old statistics