mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
fix #511, fix the bug of thread stop invalid.
This commit is contained in:
parent
6d0adb9f22
commit
1dae8fc987
2 changed files with 5 additions and 2 deletions
0
trunk/src/app/srs_app_edge.cpp
Normal file → Executable file
0
trunk/src/app/srs_app_edge.cpp
Normal file → Executable file
7
trunk/src/app/srs_app_thread.cpp
Normal file → Executable file
7
trunk/src/app/srs_app_thread.cpp
Normal file → Executable file
|
@ -100,11 +100,12 @@ namespace internal {
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
disposed = false;
|
||||||
// we set to loop to true for thread to run.
|
// we set to loop to true for thread to run.
|
||||||
loop = true;
|
loop = true;
|
||||||
|
|
||||||
// wait for cid to ready, for parent thread to get the cid.
|
// wait for cid to ready, for parent thread to get the cid.
|
||||||
while (_cid < 0 && loop) {
|
while (_cid < 0) {
|
||||||
st_usleep(10 * 1000);
|
st_usleep(10 * 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -124,7 +125,9 @@ namespace internal {
|
||||||
|
|
||||||
dispose();
|
dispose();
|
||||||
|
|
||||||
tid = NULL;
|
_cid = -1;
|
||||||
|
can_run = false;
|
||||||
|
tid = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SrsThread::can_loop()
|
bool SrsThread::can_loop()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue