}
void App::enqueue_flushdraw(int surface_id) {
+ // lock by mutex
+ std::lock_guard<std::mutex> lock(this->mtx);
+
this->check_flushdraw(surface_id);
HMI_DEBUG("wm", "Enqueuing EndDraw for surface_id %d", surface_id);
this->pending_end_draw.push_back(surface_id);
}
void App::api_enddraw(char const *appid, char const *drawing_name) {
+ // lock by mutex
+ std::lock_guard<std::mutex> lock(this->mtx);
+
// Convert drawing_name to role
const char* role = this->convertDrawingNameToRole(drawing_name);
}
void App::deactivate(int id) {
+ // lock by mutex
+ std::lock_guard<std::mutex> lock(this->mtx);
+
auto ip = this->controller->sprops.find(id);
if (ip != this->controller->sprops.end()) {
char const *label =
#include <unordered_map>
#include <unordered_set>
#include <experimental/optional>
+#include <mutex>
#include "config.hpp"
#include "controller_hooks.hpp"
#include "layers.hpp"
std::unordered_map<std::string, std::string> role2drawingname_;
std::unordered_map<int, int> appid2role_;
CarInfo crr_car_info_;
+ std::mutex mtx;
int allocateSurface();
void setSurfaceSize(const char* role, const char* area);