mirror of
https://gitlab.xiph.org/xiph/icecast-server.git
synced 2024-09-08 04:04:48 -04:00
46 lines
896 B
C
46 lines
896 B
C
/* -*- c-basic-offset: 4; indent-tabs-mode: nil; -*- */
|
|
#include <string.h>
|
|
|
|
#include "thread.h"
|
|
#include "avl.h"
|
|
|
|
#include "httpp.h"
|
|
#include "connection.h"
|
|
#include "refbuf.h"
|
|
#include "client.h"
|
|
#include "source.h"
|
|
#include "format.h"
|
|
|
|
#include "global.h"
|
|
|
|
ice_global_t global;
|
|
|
|
static mutex_t _global_mutex;
|
|
|
|
void global_initialize(void)
|
|
{
|
|
memset(global.serversock, 0, sizeof(int)*MAX_LISTEN_SOCKETS);
|
|
global.server_sockets = 0;
|
|
global.running = 0;
|
|
global.clients = 0;
|
|
global.sources = 0;
|
|
global.source_tree = avl_tree_new(source_compare_sources, NULL);
|
|
thread_mutex_create(&_global_mutex);
|
|
}
|
|
|
|
void global_shutdown(void)
|
|
{
|
|
thread_mutex_destroy(&_global_mutex);
|
|
avl_tree_free(global.source_tree, source_free_source);
|
|
}
|
|
|
|
void global_lock(void)
|
|
{
|
|
thread_mutex_lock(&_global_mutex);
|
|
}
|
|
|
|
void global_unlock(void)
|
|
{
|
|
thread_mutex_unlock(&_global_mutex);
|
|
}
|