|
@@ -434,8 +434,6 @@ namespace Chromium {
|
|
|
boost::thread(boost::bind(SaveCefclientLog, magicStr)).detach();
|
|
|
}
|
|
|
#endif
|
|
|
-
|
|
|
- boost::thread(boost::bind(&CChromiumEntity::DoWithSysVarEvent, this)).detach();//用于处理sysvar,避免由于阻塞动作,导致实体卡住,lost
|
|
|
}
|
|
|
if (m_withSpecialTest)
|
|
|
{
|
|
@@ -689,6 +687,7 @@ namespace Chromium {
|
|
|
|
|
|
#endif
|
|
|
OnPreStart_Init(m_strArgs, m_pTransactionContext);//初始化部分, perf ,killchromium, signal, get custom url
|
|
|
+ boost::thread(boost::bind(&CChromiumEntity::DoWithSysVarEvent, this)).detach();//用于处理sysvar,避免由于阻塞动作,导致实体卡住,lost
|
|
|
if (!OnPreStart_socketStart(m_strArgs, m_pTransactionContext)) {//OnPreStart_socketStart()->new CWebsocketServer(strStructPath, this) 时间过长
|
|
|
return;
|
|
|
}
|
|
@@ -823,7 +822,7 @@ namespace Chromium {
|
|
|
DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("create thread:%s", __FUNCTION__);
|
|
|
while (true)
|
|
|
{
|
|
|
- if (m_eventArr.empty())
|
|
|
+ if (m_eventArr.size() == 0)
|
|
|
{
|
|
|
boost::this_thread::sleep_for(boost::chrono::microseconds(100));
|
|
|
continue;
|
|
@@ -874,19 +873,19 @@ namespace Chromium {
|
|
|
CSimpleStringA cmd = CSimpleStringA::Format("sudo kill -9 %d", it);
|
|
|
DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("CloseCommonPage %s", cmd.GetData());
|
|
|
system(cmd.GetData());
|
|
|
- }
|
|
|
+ }
|
|
|
#else
|
|
|
CModTools::get_mutable_instance().StopChromiumBrowser(ERR_PAGE_REASON::startup);
|
|
|
#endif
|
|
|
|
|
|
//DbgEx("UnregistSysVarEvent TerminalStage %s", Error_Succeed == GetFunction()->UnregistSysVarEvent("TerminalStage") ? "success" : "fail");
|
|
|
- }
|
|
|
- }
|
|
|
+ }
|
|
|
+ }
|
|
|
catch (const std::exception& e)
|
|
|
{
|
|
|
DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("TerminalStage:A run exception, %s", e.what());
|
|
|
}
|
|
|
- }
|
|
|
+ }
|
|
|
else if (0 == CSimpleStringA("X").Compare(curEvent.value.c_str(), true))
|
|
|
DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("TerminalStage X, do nothing.");
|
|
|
else
|
|
@@ -963,10 +962,10 @@ namespace Chromium {
|
|
|
{
|
|
|
DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("OnSysVarEvent %s, old->new:%s->%s", pszKey, pszOldValue, pszValue);
|
|
|
SYS_EVENT_PARAM curEvent;
|
|
|
- curEvent.key = pszKey;
|
|
|
- curEvent.value = pszValue;
|
|
|
- curEvent.oldValue = pszOldValue;
|
|
|
- curEvent.entityName = pszEntityName;
|
|
|
+ curEvent.key = std::string(pszKey);
|
|
|
+ curEvent.value = std::string(pszValue);
|
|
|
+ curEvent.oldValue = std::string(pszOldValue);
|
|
|
+ curEvent.entityName = std::string(pszEntityName);
|
|
|
boost::unique_lock<boost::mutex> eventArrLock(m_eventContorl);
|
|
|
m_eventArr.push_back(curEvent);
|
|
|
|