1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

research st: refine event, io and key.

This commit is contained in:
winlin 2014-11-06 13:40:24 +08:00
parent c38a545780
commit f5f8e8946f
3 changed files with 129 additions and 155 deletions

View file

@ -43,14 +43,12 @@
#include <errno.h>
#include "common.h"
/*
* Destructor table for per-thread private data
*/
static _st_destructor_t _st_destructors[ST_KEYS_MAX];
static int key_max = 0;
/*
* Return a key to be used for thread specific data
*/
@ -67,13 +65,11 @@ int st_key_create(int *keyp, _st_destructor_t destructor)
return 0;
}
int st_key_getlimit(void)
{
return ST_KEYS_MAX;
}
int st_thread_setspecific(int key, void *value)
{
_st_thread_t *me = _ST_CURRENT_THREAD();
@ -94,7 +90,6 @@ int st_thread_setspecific(int key, void *value)
return 0;
}
void *st_thread_getspecific(int key)
{
if (key < 0 || key >= key_max) {
@ -104,7 +99,6 @@ void *st_thread_getspecific(int key)
return ((_ST_CURRENT_THREAD())->private_data[key]);
}
/*
* Free up all per-thread private data
*/