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

ST: Support thread-local for multiple threads.

1. All statick and global variables is thread-local.
2. Call st_init() to init st for each thread.
3. Notice that ST is isolate for threads.
This commit is contained in:
winlin 2021-04-05 12:37:53 +08:00
parent d117145b95
commit 339d3b31cc
8 changed files with 61 additions and 54 deletions

View file

@ -47,9 +47,9 @@
#include "common.h"
extern time_t _st_curr_time;
extern st_utime_t _st_last_tset;
extern int _st_active_count;
extern __thread time_t _st_curr_time;
extern __thread st_utime_t _st_last_tset;
extern __thread int _st_active_count;
static st_utime_t (*_st_utime)(void) = NULL;