【修改】增加活动线程判断,防止为0时出现错误
This commit is contained in:
@@ -334,6 +334,9 @@ struct lua_plugin_manage_schema *lua_plugin_manage_init(
|
|||||||
utarray_new(new_schema->message_mq_array, &lua_message_mq_icd);
|
utarray_new(new_schema->message_mq_array, &lua_message_mq_icd);
|
||||||
|
|
||||||
int thread_count = stellar_get_worker_thread_num(st);
|
int thread_count = stellar_get_worker_thread_num(st);
|
||||||
|
if (thread_count == 0)
|
||||||
|
/* 无活动线程 */
|
||||||
|
return new_schema;
|
||||||
#ifdef LUAPLUGIN_BASIC_UNITTEST
|
#ifdef LUAPLUGIN_BASIC_UNITTEST
|
||||||
LOGDEBUG("get stellar thread num is %d", thread_count);
|
LOGDEBUG("get stellar thread num is %d", thread_count);
|
||||||
#endif
|
#endif
|
||||||
@@ -597,7 +600,7 @@ void debug_lua_plugin_manage_schema(struct lua_plugin_manage_schema *schema)
|
|||||||
for (int i = 0; i < schema->model_count; ++i)
|
for (int i = 0; i < schema->model_count; ++i)
|
||||||
{
|
{
|
||||||
printf("debug model[%d]\n", i);
|
printf("debug model[%d]\n", i);
|
||||||
printf("array %p, load %d, unload %d, env %d, mark %04x, count %04x\n",
|
printf("array %p, load %d, unload %d, env %d, mark %04x, count %d\n",
|
||||||
schema->model[i].plugin_array, schema->model[i].load_ref, schema->model[i].unload_ref,
|
schema->model[i].plugin_array, schema->model[i].load_ref, schema->model[i].unload_ref,
|
||||||
schema->model[i].private_env_ref, schema->model[i].model_mark, schema->model[i].plugin_count);
|
schema->model[i].private_env_ref, schema->model[i].model_mark, schema->model[i].plugin_count);
|
||||||
struct lua_plugin *plugin = NULL;
|
struct lua_plugin *plugin = NULL;
|
||||||
@@ -606,6 +609,7 @@ void debug_lua_plugin_manage_schema(struct lua_plugin_manage_schema *schema)
|
|||||||
printf("%d, %d, %d\n", plugin->plugin_id, plugin->ctx_new_ref, plugin->ctx_free_ref);
|
printf("%d, %d, %d\n", plugin->plugin_id, plugin->ctx_new_ref, plugin->ctx_free_ref);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
printf("schema total plugin count is %d\n", schema->plugin_count);
|
||||||
|
|
||||||
printf("***** end of debug one lua schema *****\n\n");
|
printf("***** end of debug one lua schema *****\n\n");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user