From 1dae8fc987a7dc951e5d739b5c04b65448b655ff Mon Sep 17 00:00:00 2001 From: zhengfl Date: Thu, 5 Nov 2015 13:39:41 +0800 Subject: [PATCH] fix #511, fix the bug of thread stop invalid. --- trunk/src/app/srs_app_edge.cpp | 0 trunk/src/app/srs_app_thread.cpp | 7 +++++-- 2 files changed, 5 insertions(+), 2 deletions(-) mode change 100644 => 100755 trunk/src/app/srs_app_edge.cpp mode change 100644 => 100755 trunk/src/app/srs_app_thread.cpp diff --git a/trunk/src/app/srs_app_edge.cpp b/trunk/src/app/srs_app_edge.cpp old mode 100644 new mode 100755 diff --git a/trunk/src/app/srs_app_thread.cpp b/trunk/src/app/srs_app_thread.cpp old mode 100644 new mode 100755 index 274c16f6b..bed357397 --- a/trunk/src/app/srs_app_thread.cpp +++ b/trunk/src/app/srs_app_thread.cpp @@ -100,11 +100,12 @@ namespace internal { return ret; } + disposed = false; // we set to loop to true for thread to run. loop = true; // wait for cid to ready, for parent thread to get the cid. - while (_cid < 0 && loop) { + while (_cid < 0) { st_usleep(10 * 1000); } @@ -124,7 +125,9 @@ namespace internal { dispose(); - tid = NULL; + _cid = -1; + can_run = false; + tid = NULL; } bool SrsThread::can_loop()