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

ST: Support set context id while thread running. v5.0.72

This commit is contained in:
winlin 2022-10-02 10:05:01 +08:00
parent 9525511032
commit dc20d5ddbc
12 changed files with 96 additions and 15 deletions

View file

@ -79,7 +79,12 @@ int st_key_getlimit(void)
int st_thread_setspecific(int key, void *value)
{
_st_thread_t *me = _ST_CURRENT_THREAD();
return st_thread_setspecific2(me, key, value);
}
int st_thread_setspecific2(_st_thread_t *me, int key, void *value)
{
if (key < 0 || key >= key_max) {
errno = EINVAL;
return -1;

View file

@ -156,6 +156,8 @@ extern int st_sendmsg(st_netfd_t fd, const struct msghdr *msg, int flags, st_uti
extern st_netfd_t st_open(const char *path, int oflags, mode_t mode);
extern int st_thread_setspecific2(st_thread_t thread, int key, void *value);
#ifdef DEBUG
extern void _st_show_thread_stack(st_thread_t thread, const char *messg);
extern void _st_iterate_threads(void);

View file

@ -689,7 +689,6 @@ _st_thread_t *st_thread_self(void)
return _ST_CURRENT_THREAD();
}
#ifdef DEBUG
/* ARGSUSED */
void _st_show_thread_stack(_st_thread_t *thread, const char *messg)