Create a mutex for UI that will help make it possible to run handlers that update UI elements on seprate threads. its far from perfect but should hold up for now.
11 lines
221 B
C++
11 lines
221 B
C++
#pragma once
|
|
#include <mutex>
|
|
|
|
class LvglMutex {
|
|
public:
|
|
[[nodiscard]] static std::lock_guard<std::mutex> lockScope() {
|
|
return std::lock_guard<std::mutex>(mLvglMutex);
|
|
}
|
|
|
|
inline static std::mutex mLvglMutex;
|
|
};
|