Committed by
winlin
fix #511, fix the bug of thread stop invalid.
正在显示
2 个修改的文件
包含
4 行增加
和
1 行删除
trunk/src/app/srs_app_edge.cpp
100644 → 100755
trunk/src/app/srs_app_thread.cpp
100644 → 100755
| @@ -100,11 +100,12 @@ namespace internal { | @@ -100,11 +100,12 @@ namespace internal { | ||
| 100 | return ret; | 100 | return ret; |
| 101 | } | 101 | } |
| 102 | 102 | ||
| 103 | + disposed = false; | ||
| 103 | // we set to loop to true for thread to run. | 104 | // we set to loop to true for thread to run. |
| 104 | loop = true; | 105 | loop = true; |
| 105 | 106 | ||
| 106 | // wait for cid to ready, for parent thread to get the cid. | 107 | // wait for cid to ready, for parent thread to get the cid. |
| 107 | - while (_cid < 0 && loop) { | 108 | + while (_cid < 0) { |
| 108 | st_usleep(10 * 1000); | 109 | st_usleep(10 * 1000); |
| 109 | } | 110 | } |
| 110 | 111 | ||
| @@ -124,6 +125,8 @@ namespace internal { | @@ -124,6 +125,8 @@ namespace internal { | ||
| 124 | 125 | ||
| 125 | dispose(); | 126 | dispose(); |
| 126 | 127 | ||
| 128 | + _cid = -1; | ||
| 129 | + can_run = false; | ||
| 127 | tid = NULL; | 130 | tid = NULL; |
| 128 | } | 131 | } |
| 129 | 132 |
-
请 注册 或 登录 后发表评论