mirror of
https://github.com/ossrs/srs.git
synced 2025-02-15 04:42:04 +00:00
research st, add comments about the thread cycle
This commit is contained in:
parent
8327a57b7e
commit
683b01a6c9
1 changed files with 6 additions and 3 deletions
|
@ -83,9 +83,6 @@ int thread_test()
|
||||||
st_thread_join(trd, NULL);
|
st_thread_join(trd, NULL);
|
||||||
srs_trace("3. thread joined");
|
srs_trace("3. thread joined");
|
||||||
|
|
||||||
st_thread_exit(NULL);
|
|
||||||
srs_trace("4. all thread completed");
|
|
||||||
|
|
||||||
srs_trace("thread test: end");
|
srs_trace("thread test: end");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -385,7 +382,13 @@ int main(int argc, char** argv)
|
||||||
}
|
}
|
||||||
|
|
||||||
// cleanup.
|
// cleanup.
|
||||||
|
srs_trace("wait for all thread completed");
|
||||||
st_thread_exit(NULL);
|
st_thread_exit(NULL);
|
||||||
|
// the following never enter,
|
||||||
|
// the above code will exit when all thread exit,
|
||||||
|
// current is a primordial st-thread, when all thread exit,
|
||||||
|
// the st idle thread will exit(0), see _st_idle_thread_start()
|
||||||
|
srs_trace("all thread completed");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue