2001-09-09 22:21:46 -04:00
|
|
|
#include "thread.h"
|
|
|
|
#include "avl.h"
|
|
|
|
|
|
|
|
#include "httpp.h"
|
|
|
|
#include "connection.h"
|
|
|
|
#include "refbuf.h"
|
2002-08-16 10:26:48 -04:00
|
|
|
#include "client.h"
|
2003-02-02 09:31:34 -05:00
|
|
|
#include "geturl.h"
|
2001-09-09 22:21:46 -04:00
|
|
|
#include "source.h"
|
2002-12-30 02:55:56 -05:00
|
|
|
#include "format.h"
|
2001-09-09 22:21:46 -04:00
|
|
|
|
|
|
|
#include "global.h"
|
|
|
|
|
|
|
|
ice_global_t global;
|
|
|
|
|
|
|
|
static mutex_t _global_mutex;
|
|
|
|
|
|
|
|
void global_initialize(void)
|
|
|
|
{
|
2002-11-22 08:00:44 -05:00
|
|
|
global.serversock = -1;
|
2001-09-09 22:21:46 -04:00
|
|
|
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);
|
|
|
|
}
|