Split off RecursiveMutex from Mutex (#437)
* Split off RecursiveMutex from Mutex * Fix * Code quality
This commit is contained in:
committed by
GitHub
parent
f48654d3dc
commit
3fc2ff8bc6
@@ -17,8 +17,8 @@ typedef std::unordered_map<std::string, std::shared_ptr<ServiceInstance>> Servic
|
||||
static ManifestMap service_manifest_map;
|
||||
static ServiceInstanceMap service_instance_map;
|
||||
|
||||
static Mutex manifest_mutex(Mutex::Type::Normal);
|
||||
static Mutex instance_mutex(Mutex::Type::Normal);
|
||||
static Mutex manifest_mutex;
|
||||
static Mutex instance_mutex;
|
||||
|
||||
void addService(std::shared_ptr<const ServiceManifest> manifest, bool autoStart) {
|
||||
assert(manifest != nullptr);
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#include <Tactility/EventFlag.h>
|
||||
#include <Tactility/Tactility.h>
|
||||
#include <Tactility/kernel/SystemEvents.h>
|
||||
#include <Tactility/RecursiveMutex.h>
|
||||
#include <Tactility/service/ServiceContext.h>
|
||||
#include <Tactility/service/wifi/WifiGlobals.h>
|
||||
#include <Tactility/service/wifi/WifiSettings.h>
|
||||
@@ -48,8 +49,8 @@ class Wifi {
|
||||
public:
|
||||
|
||||
/** @brief Locking mechanism for modifying the Wifi instance */
|
||||
Mutex radioMutex = Mutex(Mutex::Type::Recursive);
|
||||
Mutex dataMutex = Mutex(Mutex::Type::Recursive);
|
||||
RecursiveMutex radioMutex;
|
||||
RecursiveMutex dataMutex;
|
||||
std::unique_ptr<Timer> autoConnectTimer;
|
||||
/** @brief The public event bus */
|
||||
std::shared_ptr<PubSub<WifiEvent>> pubsub = std::make_shared<PubSub<WifiEvent>>();
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
|
||||
#include <Tactility/Check.h>
|
||||
#include <Tactility/Log.h>
|
||||
#include <Tactility/Mutex.h>
|
||||
#include <Tactility/PubSub.h>
|
||||
#include <Tactility/RecursiveMutex.h>
|
||||
#include <Tactility/service/Service.h>
|
||||
#include <Tactility/service/ServiceManifest.h>
|
||||
|
||||
@@ -15,7 +15,7 @@ constexpr auto* TAG = "Wifi";
|
||||
|
||||
struct Wifi {
|
||||
/** @brief Locking mechanism for modifying the Wifi instance */
|
||||
Mutex mutex = Mutex(Mutex::Type::Recursive);
|
||||
RecursiveMutex mutex;
|
||||
/** @brief The public event bus */
|
||||
std::shared_ptr<PubSub<WifiEvent>> pubsub = std::make_shared<PubSub<WifiEvent>>();
|
||||
/** @brief The internal message queue */
|
||||
|
||||
Reference in New Issue
Block a user