void AppList::addClient(const string &appid, const string &role)
{
+ std::lock_guard<std::mutex> lock(mtx);
shared_ptr<WMClient> client = std::make_shared<WMClient>(appid, role);
this->app2client[appid] = client;
this->clientDump();
void AppList::addClient(const std::string &appid, unsigned layer, unsigned surface, const std::string &role)
{
+ std::lock_guard<std::mutex> lock(mtx);
shared_ptr<WMClient> client = std::make_shared<WMClient>(appid, layer, surface, role);
this->app2client[appid] = client;
this->clientDump();
void AppList::removeClient(const string &appid)
{
+ std::lock_guard<std::mutex> lock(mtx);
this->app2client.erase(appid);
+ HMI_INFO("wm", "Remove client %s", appid.c_str());
}
bool AppList::contains(const string &appid) const
void AppList::removeSurface(unsigned surface_id){
// This function may be very slow
+ std::lock_guard<std::mutex> lock(mtx);
bool ret = false;
for (auto &x : this->app2client)
{
break;
}
}
+
}
/**
return this->current_req;
}
-// Is this function necessary ?
unsigned AppList::getRequestNumber(const string &appid) const
{
for (const auto &x : this->req_list)
unsigned AppList::addAllocateRequest(WMRequest req)
{
+ std::lock_guard<std::mutex> lock(mtx);
if (this->req_list.size() == 0)
{
req.req_num = current_req;
}
else
{
- HMI_SEQ_DEBUG(this->current_req, "add: %d", this->req_list.back().req_num + 1);
+ HMI_SEQ_INFO(this->current_req, "add: %d", this->req_list.back().req_num + 1);
req.req_num = this->req_list.back().req_num + 1;
}
this->req_list.push_back(req);
- return req.req_num; // return 1; if you test time_expire
+ return req.req_num;
}
struct WMTrigger AppList::getRequest(unsigned req_num, bool *found)
return x.trigger;
}
}
+ HMI_SEQ_ERROR(req_num, "Couldn't get request : %d", req_num);
return WMTrigger{"", "", "", Task::TASK_INVALID};
}
return x.sync_draw_req;
}
}
+ HMI_SEQ_ERROR(req_num, "Couldn't get action with the request : %d", req_num);
}
WMError AppList::setAction(unsigned req_num, const struct WMAction &action)
{
+ std::lock_guard<std::mutex> lock(mtx);
WMError result = WMError::FAIL;
for (auto &x : this->req_list)
{
result = WMError::SUCCESS;
break;
}
-
return result;
}
*/
WMError AppList::setAction(unsigned req_num, const string &appid, const string &role, const string &area, bool visible)
{
+ std::lock_guard<std::mutex> lock(mtx);
WMError result = WMError::NOT_REGISTERED;
for (auto &x : req_list)
{
*/
bool AppList::setEndDrawFinished(unsigned req_num, const string &appid, const string &role)
{
+ std::lock_guard<std::mutex> lock(mtx);
bool result = false;
for (auto &x : req_list)
{
void AppList::removeRequest(unsigned req_num)
{
+ std::lock_guard<std::mutex> lock(mtx);
this->req_list.erase(remove_if(this->req_list.begin(), this->req_list.end(),
[req_num](WMRequest x) {
return x.req_num == req_num;
void AppList::next()
{
+ std::lock_guard<std::mutex> lock(mtx);
++this->current_req;
if (0 == this->current_req)
{