mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
Core: Refine ST stat for thread switch
This commit is contained in:
parent
e726aba8f9
commit
71cc8e35d9
2 changed files with 26 additions and 2 deletions
11
trunk/3rdparty/st-srs/sched.c
vendored
11
trunk/3rdparty/st-srs/sched.c
vendored
|
@ -63,6 +63,9 @@ unsigned long long _st_stat_sched_160ms = 0;
|
|||
unsigned long long _st_stat_sched_320ms = 0;
|
||||
unsigned long long _st_stat_sched_1000ms = 0;
|
||||
unsigned long long _st_stat_sched_s = 0;
|
||||
|
||||
unsigned long long _st_stat_thread_run = 0;
|
||||
unsigned long long _st_stat_thread_idle = 0;
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -131,10 +134,18 @@ void _st_vp_schedule(void)
|
|||
_st_thread_t *thread;
|
||||
|
||||
if (_ST_RUNQ.next != &_ST_RUNQ) {
|
||||
#ifdef DEBUG
|
||||
++_st_stat_thread_run;
|
||||
#endif
|
||||
|
||||
/* Pull thread off of the run queue */
|
||||
thread = _ST_THREAD_PTR(_ST_RUNQ.next);
|
||||
_ST_DEL_RUNQ(thread);
|
||||
} else {
|
||||
#ifdef DEBUG
|
||||
++_st_stat_thread_idle;
|
||||
#endif
|
||||
|
||||
/* If there are no threads to run, switch to the idle thread */
|
||||
thread = _st_this_vp.idle_thread;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue