aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwang_zhiqiang <wang_zhiqiang@dl.cn.nexty-ele.com>2019-05-29 16:58:13 +0800
committerwang_zhiqiang <wang_zhiqiang@dl.cn.nexty-ele.com>2019-05-29 16:58:13 +0800
commit6721f3fbd9d3e5de3b41ce1859ae6034da474a8d (patch)
tree2a36e0fcc30630d6177de401b515a25ff4842a87
parent8f0e20df04e0e6826adc425519840b56d6169404 (diff)
modify thread
Change-Id: Ifa336b4eac43941466561e135eb000b344f02a10
-rw-r--r--src/homescreen.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/homescreen.cpp b/src/homescreen.cpp
index b3980b2..cff2810 100644
--- a/src/homescreen.cpp
+++ b/src/homescreen.cpp
@@ -41,7 +41,7 @@ const char _keyId[] = "id";
struct hs_handshake {
hs_handshake(int times, int sleep) : m_times(times), m_sleep(sleep) {}
int start(afb_api_t api);
- void handshake_loop(afb_api_t api);
+ void handshake_loop(afb_api_t api, int times, int sleeps);
enum HandshakeStatus {
Handshake_Idle = 0,
@@ -121,7 +121,7 @@ int hs_handshake::start(afb_api_t api)
AFB_NOTICE("start handshake with windowmanager.");
setEventHook(sub_event.c_str(), on_handshake_event);
- std::thread th(&hs_handshake::handshake_loop, this, api);
+ std::thread th(&hs_handshake::handshake_loop, this, api, m_times, m_sleep);
th.detach();
return 0;
}
@@ -136,7 +136,7 @@ int hs_handshake::start(afb_api_t api)
* None
*
*/
-void hs_handshake::handshake_loop(afb_api_t api)
+void hs_handshake::handshake_loop(afb_api_t api, int times, int sleeps)
{
int count = 0;
do {
@@ -154,9 +154,9 @@ void hs_handshake::handshake_loop(afb_api_t api)
}
++count;
- usleep(m_sleep*1000);
- } while(count < m_times);
- AFB_NOTICE("handshake over, count=%d.", count);
+ usleep(sleeps*1000);
+ } while(count < times);
+ AFB_NOTICE("handshake over, m_times=%d, m_sleep=%d, count=%d.", times, sleeps, count);
HS_AppRecover::instance()->startRecovery(api);
}