DevMgr:at/detachSenseDevReq: Acquire DevMgr Qutex
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
#include <memory>
|
||||
#include <opts.h>
|
||||
#include <asynchronousContinuation.h>
|
||||
#include <serializedAsynchronousContinuation.h>
|
||||
#include <callback.h>
|
||||
#include <componentThread.h>
|
||||
#include <deviceManager/deviceManager.h>
|
||||
@@ -316,15 +317,15 @@ void DeviceManager::removeDeviceAttachmentSpecReq(
|
||||
}
|
||||
|
||||
class DeviceManager::AttachSenseDeviceReq
|
||||
: public PostedAsynchronousContinuation<attachSenseDeviceReqCbFn>
|
||||
: public SerializedAsynchronousContinuation<attachSenseDeviceReqCbFn>
|
||||
{
|
||||
public:
|
||||
AttachSenseDeviceReq(
|
||||
const std::shared_ptr<DeviceAttachmentSpec>& spec,
|
||||
const std::shared_ptr<ComponentThread> &caller,
|
||||
Callback<attachSenseDeviceReqCbFn> cb)
|
||||
: PostedAsynchronousContinuation<attachSenseDeviceReqCbFn>(
|
||||
caller, cb),
|
||||
: SerializedAsynchronousContinuation<attachSenseDeviceReqCbFn>(
|
||||
caller, cb, {std::ref(DeviceManager::getInstance().qutex)}),
|
||||
spec(spec)
|
||||
{}
|
||||
|
||||
@@ -469,7 +470,8 @@ void DeviceManager::attachSenseDeviceReq(
|
||||
auto request = std::make_shared<AttachSenseDeviceReq>(
|
||||
spec, caller, cb);
|
||||
|
||||
mrntt::mrntt.thread->getIoService().post(
|
||||
AttachSenseDeviceReq::LockerAndInvoker lockvoker(
|
||||
*request, mrntt::mrntt.thread,
|
||||
std::bind(
|
||||
&AttachSenseDeviceReq::attachSenseDeviceReq1_posted,
|
||||
request.get(), request));
|
||||
@@ -484,7 +486,8 @@ void DeviceManager::detachSenseDeviceReq(
|
||||
auto request = std::make_shared<DetachSenseDeviceReq>(
|
||||
spec, caller, cb);
|
||||
|
||||
mrntt::mrntt.thread->getIoService().post(
|
||||
DetachSenseDeviceReq::LockerAndInvoker lockvoker(
|
||||
*request, mrntt::mrntt.thread,
|
||||
std::bind(
|
||||
&DetachSenseDeviceReq::detachSenseDeviceReq1_posted,
|
||||
request.get(), request));
|
||||
|
||||
Reference in New Issue
Block a user