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

never use stack variable for setjmp

This commit is contained in:
winlin 2014-11-10 14:02:49 +08:00
parent 2c01f7e943
commit 8327a57b7e

3
trunk/research/st/sched.c Normal file → Executable file
View file

@ -596,8 +596,7 @@ _st_thread_t *st_thread_create(void *(*start)(void *arg), void *arg, int joinabl
trd->context[0].__jmpbuf[0].__pc = (__ptr_t) _st_thread_main; trd->context[0].__jmpbuf[0].__pc = (__ptr_t) _st_thread_main;
trd->context[0].__jmpbuf[0].__sp = stack->sp; trd->context[0].__jmpbuf[0].__sp = stack->sp;
#else #else
int ret_setjmp = 0; if (MD_SETJMP((trd)->context)) {
if ((ret_setjmp = MD_SETJMP((trd)->context)) != 0) {
_st_thread_main(); _st_thread_main();
} }
MD_GET_SP(trd) = (long) (stack->sp); MD_GET_SP(trd) = (long) (stack->sp);