DevMgr,Dev: Add Qutexes
Add Qutex locks to both DeviceManager and Device. These will be properly used in the upcoming patches.
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
#include <sstream>
|
||||
#include <user/deviceAttachmentSpec.h>
|
||||
#include <deviceManager/deviceRole.h>
|
||||
#include <qutex.h>
|
||||
|
||||
namespace smo {
|
||||
namespace device {
|
||||
@@ -14,7 +15,9 @@ namespace device {
|
||||
class Device
|
||||
{
|
||||
public:
|
||||
Device(const std::string& identifier) : deviceIdentifier(identifier) {}
|
||||
Device(const std::string& identifier)
|
||||
: deviceIdentifier(identifier), qutex("Device-" + identifier)
|
||||
{}
|
||||
|
||||
std::string stringify() const
|
||||
{
|
||||
@@ -30,6 +33,7 @@ public:
|
||||
public:
|
||||
std::string deviceIdentifier;
|
||||
std::vector<std::shared_ptr<DeviceRole>> deviceRoles;
|
||||
Qutex qutex;
|
||||
};
|
||||
|
||||
} // namespace device
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
#include <deviceManager/device.h>
|
||||
#include <deviceManager/deviceRole.h>
|
||||
#include <callback.h>
|
||||
#include <qutex.h>
|
||||
|
||||
namespace smo {
|
||||
namespace device {
|
||||
@@ -69,17 +70,20 @@ public:
|
||||
Callback<detachAllSenseDevicesReqCbFn> cb);
|
||||
|
||||
private:
|
||||
DeviceManager() = default;
|
||||
DeviceManager()
|
||||
: qutex("DeviceManager")
|
||||
{}
|
||||
~DeviceManager() = default;
|
||||
DeviceManager(const DeviceManager&) = delete;
|
||||
DeviceManager& operator=(const DeviceManager&) = delete;
|
||||
|
||||
public:
|
||||
std::string allDapSpecs;
|
||||
static std::vector<std::shared_ptr<DeviceAttachmentSpec>>
|
||||
deviceAttachmentSpecs;
|
||||
static std::vector<std::shared_ptr<Device>> devices;
|
||||
static std::vector<std::shared_ptr<DeviceRole>> attachedDeviceRoles;
|
||||
Qutex qutex;
|
||||
std::string allDapSpecs;
|
||||
static std::vector<std::shared_ptr<DeviceAttachmentSpec>>
|
||||
deviceAttachmentSpecs;
|
||||
static std::vector<std::shared_ptr<Device>> devices;
|
||||
static std::vector<std::shared_ptr<DeviceRole>> attachedDeviceRoles;
|
||||
|
||||
private:
|
||||
class NewDeviceAttachmentSpecInd;
|
||||
|
||||
Reference in New Issue
Block a user