1
0
mirror of https://gitlab.xiph.org/xiph/icecast-server.git synced 2024-12-04 14:46:30 -05:00

Feature: Added a global module container object

This commit is contained in:
Philipp Schafft 2018-05-28 11:26:08 +00:00
parent bb77660020
commit 5d815f2205
3 changed files with 8 additions and 2 deletions

View File

@ -21,6 +21,8 @@
#include "common/avl/avl.h"
#include "global.h"
#include "refobject.h"
#include "module.h"
#include "source.h"
ice_global_t global;
@ -36,12 +38,14 @@ void global_initialize(void)
global.clients = 0;
global.sources = 0;
global.source_tree = avl_tree_new(source_compare_sources, NULL);
global.modulecontainer = module_container_new();
thread_mutex_create(&_global_mutex);
}
void global_shutdown(void)
{
thread_mutex_destroy(&_global_mutex);
refobject_unref(global.modulecontainer);
avl_tree_free(global.source_tree, NULL);
}

View File

@ -42,6 +42,8 @@ typedef struct ice_global_tag
/* relays retrieved from master */
relay_server *master_relays;
module_container_t *modulecontainer;
cond_t shutdown_cond;
} ice_global_t;

View File

@ -122,12 +122,12 @@ static void initialize_subsystems(void)
{
log_initialize();
thread_initialize();
global_initialize();
sock_initialize();
resolver_initialize();
config_initialize();
tls_initialize();
connection_initialize();
global_initialize();
refbuf_initialize();
xslt_initialize();
@ -146,12 +146,12 @@ static void shutdown_subsystems(void)
yp_shutdown();
stats_shutdown();
global_shutdown();
connection_shutdown();
tls_shutdown();
config_shutdown();
resolver_shutdown();
sock_shutdown();
global_shutdown();
thread_shutdown();
#ifdef HAVE_CURL