diff options
author | Kazumasa Mitsunari <knimitz@witz-inc.co.jp> | 2018-05-25 11:17:55 +0900 |
---|---|---|
committer | Kazumasa Mitsunari <knimitz@witz-inc.co.jp> | 2018-05-25 11:30:01 +0900 |
commit | 5ac52dc6412f8311b6cfbd0e99652c914d5c6168 (patch) | |
tree | ed2b67670fff877f1fca852d982f512d6195c08a /src/app.cpp | |
parent | 973a7123c0bced7c7e7d9dc6dc5e990a0e2838ac (diff) |
[Local]:5th step for blocking sequence
Change-Id: Ic47c59a77d3b45f62bed8ee2617dddc4ed58afbe
Signed-off-by: Kazumasa Mitsunari <knimitz@witz-inc.co.jp>
Diffstat (limited to 'src/app.cpp')
-rw-r--r-- | src/app.cpp | 30 |
1 files changed, 10 insertions, 20 deletions
diff --git a/src/app.cpp b/src/app.cpp index 4ec4059..7462c99 100644 --- a/src/app.cpp +++ b/src/app.cpp @@ -829,32 +829,22 @@ void App::process_request() void App::api_enddraw(char const *appid, char const *drawing_name) { std::string id(appid); - unsigned request_seq = app_list.lookUpAllocatingApp(id); + std::string role(drawing_name); unsigned current_seq = app_list.currentSequenceNumber(); - if (current_seq != request_seq) + bool result = app_list.setEndDrawFinished(current_seq, id, role); + if (!result) { - if (request_seq == 0) - { - HMI_ERROR("wm", "You don't have Window Resource"); - } - else - { - HMI_ERROR("wm", "unknown error. Application may not obey the sequence manner. please call endDraw after syncDraw"); - } + HMI_ERROR("wm", "%s doesn't have Window Resource", id.c_str()); return; } - std::string role = drawing_name; - //std::string area = drawing_area; - app_list.setEndDrawFinished(request_seq, role); - - if (app_list.endDrawFullfilled(request_seq)) + if (app_list.endDrawFullfilled(current_seq)) { // do task for endDraw - this->do_enddraw(request_seq); - app_list.removeRequest(request_seq); - HMI_SEQ_INFO(request_seq, "Finish sequence"); - app_list.setCurrentSequence(request_seq + 1); + this->do_enddraw(current_seq); + app_list.removeRequest(current_seq); + HMI_SEQ_INFO(current_seq, "Finish sequence"); + app_list.next(); if (app_list.haveRequest()) { this->process_request(); @@ -862,7 +852,7 @@ void App::api_enddraw(char const *appid, char const *drawing_name) } else { - HMI_SEQ_INFO(request_seq, "Wait other App call endDraw"); + HMI_SEQ_INFO(current_seq, "Wait other App call endDraw"); return; } for (unsigned i = 0, iend = this->pending_end_draw.size(); i < iend; i++) |