diff options
author | Mikhail Galanin <mgalanin@mimecast.com> | 2018-08-08 09:01:49 +0100 |
---|---|---|
committer | Mikhail Galanin <mgalanin@mimecast.com> | 2018-08-08 09:06:27 +0100 |
commit | 2c501018c04ca0a972c600b1324be21545e9f133 (patch) | |
tree | 7b7b81462669ae5a7c52d1956ba525e1022c5400 /src/libserver/cfg_utils.c | |
parent | 77d8a4588723e97c6f6a3cfef584a6ef5516b951 (diff) | |
download | rspamd-2c501018c04ca0a972c600b1324be21545e9f133.tar.gz rspamd-2c501018c04ca0a972c600b1324be21545e9f133.zip |
[Project] coroutine threaded model for API calls: thread pool
Diffstat (limited to 'src/libserver/cfg_utils.c')
-rw-r--r-- | src/libserver/cfg_utils.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/libserver/cfg_utils.c b/src/libserver/cfg_utils.c index b7b9dfdee..016556912 100644 --- a/src/libserver/cfg_utils.c +++ b/src/libserver/cfg_utils.c @@ -20,6 +20,7 @@ #include "uthash_strcase.h" #include "filter.h" #include "lua/lua_common.h" +#include "lua/lua_thread_pool.h" #include "map.h" #include "map_helpers.h" #include "map_private.h" @@ -175,6 +176,7 @@ rspamd_config_new (enum rspamd_config_init_flags flags) if (!(flags & RSPAMD_CONFIG_INIT_SKIP_LUA)) { cfg->lua_state = rspamd_lua_init (); cfg->own_lua_state = TRUE; + cfg->lua_thread_pool = lua_thread_pool_new (cfg->lua_state); } cfg->cache = rspamd_symbols_cache_new (cfg); @@ -259,6 +261,7 @@ rspamd_config_free (struct rspamd_config *cfg) g_ptr_array_free (cfg->c_modules, TRUE); if (cfg->lua_state && cfg->own_lua_state) { + lua_thread_pool_free (cfg->lua_thread_pool); lua_close (cfg->lua_state); } REF_RELEASE (cfg->libs_ctx); |