Lockable renamed to Lock (#219)
Also changed usage from unique_ptr to class value.
This commit is contained in:
committed by
GitHub
parent
2e86d4774b
commit
55bfb9fe3b
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user