diff options
| author | niubinghui <[email protected]> | 2024-08-30 17:00:24 +0800 |
|---|---|---|
| committer | niubinghui <[email protected]> | 2024-08-30 17:00:24 +0800 |
| commit | 0988578c6ac2452c6352f0edf57fe73ea6560d50 (patch) | |
| tree | 9b0d78fe0458e10bc9a6183d0ab5b632ee25459b | |
| parent | 2f3fb8cd373fc6664fcf770415fb35eec91cc4cf (diff) | |
【修改】增加活动线程判断,防止为0时出现错误
| -rw-r--r-- | src/lua_plugin_manage.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/lua_plugin_manage.c b/src/lua_plugin_manage.c index 1686ff0..4fd6b8e 100644 --- a/src/lua_plugin_manage.c +++ b/src/lua_plugin_manage.c @@ -334,6 +334,9 @@ struct lua_plugin_manage_schema *lua_plugin_manage_init( utarray_new(new_schema->message_mq_array, &lua_message_mq_icd); int thread_count = stellar_get_worker_thread_num(st); + if (thread_count == 0) + /* 无活动线程 */ + return new_schema; #ifdef LUAPLUGIN_BASIC_UNITTEST LOGDEBUG("get stellar thread num is %d", thread_count); #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) { 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].private_env_ref, schema->model[i].model_mark, schema->model[i].plugin_count); 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("schema total plugin count is %d\n", schema->plugin_count); printf("***** end of debug one lua schema *****\n\n"); } |
