Commit 5d815f22 authored by Philipp Schafft's avatar Philipp Schafft 🦁

Feature: Added a global module container object

parent bb776600
...@@ -21,6 +21,8 @@ ...@@ -21,6 +21,8 @@
#include "common/avl/avl.h" #include "common/avl/avl.h"
#include "global.h" #include "global.h"
#include "refobject.h"
#include "module.h"
#include "source.h" #include "source.h"
ice_global_t global; ice_global_t global;
...@@ -36,12 +38,14 @@ void global_initialize(void) ...@@ -36,12 +38,14 @@ void global_initialize(void)
global.clients = 0; global.clients = 0;
global.sources = 0; global.sources = 0;
global.source_tree = avl_tree_new(source_compare_sources, NULL); global.source_tree = avl_tree_new(source_compare_sources, NULL);
global.modulecontainer = module_container_new();
thread_mutex_create(&_global_mutex); thread_mutex_create(&_global_mutex);
} }
void global_shutdown(void) void global_shutdown(void)
{ {
thread_mutex_destroy(&_global_mutex); thread_mutex_destroy(&_global_mutex);
refobject_unref(global.modulecontainer);
avl_tree_free(global.source_tree, NULL); avl_tree_free(global.source_tree, NULL);
} }
......
...@@ -42,6 +42,8 @@ typedef struct ice_global_tag ...@@ -42,6 +42,8 @@ typedef struct ice_global_tag
/* relays retrieved from master */ /* relays retrieved from master */
relay_server *master_relays; relay_server *master_relays;
module_container_t *modulecontainer;
cond_t shutdown_cond; cond_t shutdown_cond;
} ice_global_t; } ice_global_t;
......
...@@ -122,12 +122,12 @@ static void initialize_subsystems(void) ...@@ -122,12 +122,12 @@ static void initialize_subsystems(void)
{ {
log_initialize(); log_initialize();
thread_initialize(); thread_initialize();
global_initialize();
sock_initialize(); sock_initialize();
resolver_initialize(); resolver_initialize();
config_initialize(); config_initialize();
tls_initialize(); tls_initialize();
connection_initialize(); connection_initialize();
global_initialize();
refbuf_initialize(); refbuf_initialize();
xslt_initialize(); xslt_initialize();
...@@ -146,12 +146,12 @@ static void shutdown_subsystems(void) ...@@ -146,12 +146,12 @@ static void shutdown_subsystems(void)
yp_shutdown(); yp_shutdown();
stats_shutdown(); stats_shutdown();
global_shutdown();
connection_shutdown(); connection_shutdown();
tls_shutdown(); tls_shutdown();
config_shutdown(); config_shutdown();
resolver_shutdown(); resolver_shutdown();
sock_shutdown(); sock_shutdown();
global_shutdown();
thread_shutdown(); thread_shutdown();
#ifdef HAVE_CURL #ifdef HAVE_CURL
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment