Lockable renamed to Lock (#219)

Also changed usage from unique_ptr to class value.
This commit is contained in:
Ken Van Hoeylandt
2025-02-12 22:28:22 +01:00
committed by GitHub
parent 2e86d4774b
commit 55bfb9fe3b
40 changed files with 257 additions and 263 deletions
+4 -4
View File
@@ -51,8 +51,8 @@ public:
bool hasResult() const { return resultHolder != nullptr; }
void setResult(Result result, std::unique_ptr<Bundle> resultData = nullptr) {
auto lockable = getMutex().scoped();
lockable->lock(portMAX_DELAY);
auto lock = getMutex().asScopedLock();
lock.lock();
resultHolder = std::make_unique<ResultHolder>(result, std::move(resultData));
}
@@ -61,8 +61,8 @@ public:
* Note that this removes the data from the class!
*/
bool moveResult(Result& outResult, std::unique_ptr<Bundle>& outBundle) {
auto lockable = getMutex().scoped();
lockable->lock(portMAX_DELAY);
auto lock = getMutex().asScopedLock();
lock.lock();
if (resultHolder != nullptr) {
outResult = resultHolder->result;
+2 -2
View File
@@ -1,6 +1,6 @@
#pragma once
#include <Tactility/Lockable.h>
#include <Tactility/Lock.h>
#include <memory>
@@ -25,6 +25,6 @@ void syncSet(LvglLock lock, LvglUnlock unlock);
bool lock(TickType_t timeout);
void unlock();
std::shared_ptr<Lockable> getLvglSyncLockable();
std::shared_ptr<Lock> getLvglSyncLock();
} // namespace