SenseApiLib: Add qutex for lib state access serialization

This commit is contained in:
2025-09-30 01:14:00 -04:00
parent 4bf19fda90
commit 9d77e8b345
+5 -3
View File
@@ -7,6 +7,7 @@
#include <dlfcn.h>
#include <functional>
#include <user/senseApiDesc.h>
#include <qutex.h>
namespace smo {
namespace sense_api {
@@ -29,9 +30,9 @@ public:
SenseApiLib(
const std::string& path, void *_dlopen_handle,
SMO_GET_SENSE_API_DESC_FN_TYPEDEF *descFn)
: libraryPath(path),
dlopen_handle(_dlopen_handle, DlCloser()),
SMO_GET_SENSE_API_DESC_FN_NAME(descFn)
: libraryPath(path), qutex("SenseApiLib-" + path),
dlopen_handle(_dlopen_handle, DlCloser()),
SMO_GET_SENSE_API_DESC_FN_NAME(descFn)
{}
void setSenseApiDesc(const SenseApiDesc &desc)
@@ -48,6 +49,7 @@ public:
public:
std::string libraryPath;
Qutex qutex;
std::unique_ptr<void, DlCloser> dlopen_handle;
/* UNIMPLEMENTED: API-specific cmdline options. These affect this specific
* sense api lib's behaviour globally.