summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/libcamera/base/log.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/libcamera/base/log.cpp b/src/libcamera/base/log.cpp
index 55fbd7b0..c8045ef7 100644
--- a/src/libcamera/base/log.cpp
+++ b/src/libcamera/base/log.cpp
@@ -21,6 +21,7 @@
#include <libcamera/logging.h>
#include <libcamera/base/backtrace.h>
+#include <libcamera/base/mutex.h>
#include <libcamera/base/thread.h>
#include <libcamera/base/utils.h>
@@ -788,6 +789,8 @@ LogCategory *Logger::findCategory(const char *name) const
*/
LogCategory *LogCategory::create(const char *name)
{
+ static Mutex mutex_;
+ MutexLocker locker(mutex_);
LogCategory *category = Logger::instance()->findCategory(name);
if (!category) {