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

For #907, Wrap ST, only use in service ST.

This commit is contained in:
winlin 2017-05-30 09:05:02 +08:00
parent 54411e0768
commit 1bf99e8f3e
49 changed files with 340 additions and 513 deletions

View file

@ -25,6 +25,7 @@
#include <stdarg.h>
#include <sys/time.h>
#include <unistd.h>
using namespace std;
#include <srs_kernel_error.hpp>
@ -45,18 +46,18 @@ int SrsThreadContext::generate_id()
static int id = 100;
int gid = id++;
cache[st_thread_self()] = gid;
cache[srs_thread_self()] = gid;
return gid;
}
int SrsThreadContext::get_id()
{
return cache[st_thread_self()];
return cache[srs_thread_self()];
}
int SrsThreadContext::set_id(int v)
{
st_thread_t self = st_thread_self();
srs_thread_t self = srs_thread_self();
int ov = 0;
if (cache.find(self) != cache.end()) {
@ -70,8 +71,8 @@ int SrsThreadContext::set_id(int v)
void SrsThreadContext::clear_cid()
{
st_thread_t self = st_thread_self();
std::map<st_thread_t, int>::iterator it = cache.find(self);
srs_thread_t self = srs_thread_self();
std::map<srs_thread_t, int>::iterator it = cache.find(self);
if (it != cache.end()) {
cache.erase(it);
}