|
|
@@ -839,7 +839,7 @@ int assigntoJob(HANDLE process, int pid)
|
|
|
}
|
|
|
#endif //RVC_OS_WIN
|
|
|
|
|
|
-static int create_module_process(const char *mod_name, int epid, int range, int debugFileExist, tk_process_t* new_process, int runType)
|
|
|
+static int create_module_process(const char *mod_name, int epid, int range, int debugFileExist, tk_process_t* new_process, int runType, int entity_id)
|
|
|
{
|
|
|
char app[MAX_PATH] = {'\0'};
|
|
|
int group = 0;
|
|
|
@@ -876,7 +876,7 @@ static int create_module_process(const char *mod_name, int epid, int range, int
|
|
|
else
|
|
|
sprintf(app, ".\\bin\\sphost_re.exe {%s} %d", mutexName, shellId);
|
|
|
|
|
|
- sprintf_s(writeParam, sizeof(writeParam), "%s %d %d %s %d", mod_name, epid, range, mutexName, debugFileExist);
|
|
|
+ sprintf_s(writeParam, sizeof(writeParam), "%s %d %d %s %d %d", mod_name, epid, range, mutexName, debugFileExist, entity_id);
|
|
|
|
|
|
do {
|
|
|
sp_process_t* curProcess = ZALLOC_T(sp_process_t);
|
|
|
@@ -963,7 +963,7 @@ static int create_module_process(const char *mod_name, int epid, int range, int
|
|
|
|
|
|
tk_process_t* process = NULL;
|
|
|
tk_process_option_t option;
|
|
|
- sprintf(app, "./bin/sphost %d %s %d %d", range, mod_name, epid, debugFileExist);
|
|
|
+ sprintf(app, "./bin/sphost %d %s %d %d %d", range, mod_name, epid, debugFileExist, entity_id);
|
|
|
option.exit_cb = NULL;
|
|
|
option.file = NULL;
|
|
|
option.flags = 0;
|
|
|
@@ -1771,7 +1771,7 @@ static void unlock_doing(sp_mod_mgr_t *mgr, sp_mod_t *mod)
|
|
|
#endif //_WIN32
|
|
|
}
|
|
|
|
|
|
-static int load_module(sp_mod_mgr_t *mgr, sp_mod_t *mod, int trigger_entity_id)
|
|
|
+static int load_module(sp_mod_mgr_t *mgr, sp_mod_t *mod, int trigger_entity_id, int entity_id)
|
|
|
{
|
|
|
int rc = 0;
|
|
|
sp_env_t *env = sp_get_env();
|
|
|
@@ -1785,7 +1785,7 @@ static int load_module(sp_mod_mgr_t *mgr, sp_mod_t *mod, int trigger_entity_id)
|
|
|
#endif //_WIN32
|
|
|
if (!mod->loaded) {
|
|
|
ResetEvent(mod->evt_app_exit);
|
|
|
- if (0 != create_module_process(mod->cfg->name, mod->cfg->idx, env->shm_range, mod->cfg->debugFileExist, &mod->process, mod->cfg->runType)) {
|
|
|
+ if (0 != create_module_process(mod->cfg->name, mod->cfg->idx, env->shm_range, mod->cfg->debugFileExist, &mod->process, mod->cfg->runType, entity_id)) {
|
|
|
DbgWithLinkForC(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM, "sp_mod_mgr_load_module %s failed! create module process failed", mod->cfg->name);
|
|
|
rc = Error_Unexpect;
|
|
|
} else {
|
|
|
@@ -2462,7 +2462,7 @@ int sp_mod_mgr_start_entity(sp_mod_mgr_t *mgr, int entity_id, const char *cmdlin
|
|
|
ent = sp_mod_mgr_find_entity_by_idx(mgr, entity_id);
|
|
|
if (!ent)
|
|
|
return Error_NotExist;
|
|
|
- return sp_mod_mgr_start_entity2(mgr, ent, cmdline, trigger_entity_id);
|
|
|
+ return sp_mod_mgr_start_entity2(mgr, ent, cmdline, trigger_entity_id, entity_id);
|
|
|
}
|
|
|
|
|
|
int sp_mod_mgr_stop_entity(sp_mod_mgr_t *mgr, int entity_id, int trigger_entity_id, int cause_code)
|
|
|
@@ -2555,7 +2555,7 @@ int sp_mod_mgr_terminate_all_entity(sp_mod_mgr_t* mgr, int trigger_entity_id)
|
|
|
return rc;
|
|
|
}
|
|
|
|
|
|
-int sp_mod_mgr_start_entity2(sp_mod_mgr_t *mgr, sp_entity_t *ent, const char *cmdline, int trigger_entity_id)
|
|
|
+int sp_mod_mgr_start_entity2(sp_mod_mgr_t *mgr, sp_entity_t *ent, const char *cmdline, int trigger_entity_id, int entity_id)
|
|
|
{
|
|
|
int rc = 0;
|
|
|
ULONGLONG curTickCount;
|
|
|
@@ -2576,7 +2576,7 @@ int sp_mod_mgr_start_entity2(sp_mod_mgr_t *mgr, sp_entity_t *ent, const char *cm
|
|
|
GetLocalTime(&ent->cfg->m_EntityStartTime);
|
|
|
#endif //_MSC_VER
|
|
|
if (!ent->mod->loaded)
|
|
|
- rc = load_module(mgr, ent->mod, trigger_entity_id); //start Entity process return init ok
|
|
|
+ rc = load_module(mgr, ent->mod, trigger_entity_id, entity_id); //start Entity process return init ok
|
|
|
if (isFirstStart)
|
|
|
#if defined(_MSC_VER)
|
|
|
ent->cfg->m_EntityInitEndTime.longPart = sp_cfg_getShellFirstStartTime().longPart + clock() * 10000;
|