Change-Id: Ifa336b4eac43941466561e135eb000b344f02a10
struct hs_handshake {
hs_handshake(int times, int sleep) : m_times(times), m_sleep(sleep) {}
int start(afb_api_t api);
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,
enum HandshakeStatus {
Handshake_Idle = 0,
AFB_NOTICE("start handshake with windowmanager.");
setEventHook(sub_event.c_str(), on_handshake_event);
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);
-void hs_handshake::handshake_loop(afb_api_t api)
+void hs_handshake::handshake_loop(afb_api_t api, int times, int sleeps)
- 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);
}
HS_AppRecover::instance()->startRecovery(api);
}