File locking deprecation replacements (#593)

This commit is contained in:
Ken Van Hoeylandt
2026-07-27 23:48:02 +02:00
committed by GitHub
parent d1f06cb774
commit 58a529cc44
16 changed files with 231 additions and 220 deletions
+3 -3
View File
@@ -1,14 +1,14 @@
#include <Tactility/lvgl/LabelUtils.h>
#include <Tactility/file/File.h>
#include <Tactility/file/FileLock.h>
namespace tt::lvgl {
bool label_set_text_file(lv_obj_t* label, const char* filepath) {
std::unique_ptr<uint8_t[]> text;
file::getLock(filepath)->withLock([&text, filepath] {
{
file::FileMutexGuard guard(filepath);
text = file::readString(filepath);
});
}
if (text != nullptr) {
lv_label_set_text(label, reinterpret_cast<const char*>(text.get()));