1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-02-15 04:42:04 +00:00

fix #195: remove the confuse code st_usleep(0). 2.0.13.

This commit is contained in:
winlin 2014-11-11 13:40:09 +08:00
parent 4f34ac022f
commit 46330dd196
6 changed files with 2 additions and 21 deletions

View file

@ -242,6 +242,7 @@ Supported operating systems and hardware:
* 2013-10-17, Created.<br/> * 2013-10-17, Created.<br/>
## History ## History
* v2.0, 2014-11-08, fix [#195](https://github.com/winlinvip/simple-rtmp-server/issues/195), remove the confuse code st_usleep(0). 2.0.13.
* v2.0, 2014-11-08, fix [#191](https://github.com/winlinvip/simple-rtmp-server/issues/191), configure --export-librtmp-project and --export-librtmp-single. 2.0.11. * v2.0, 2014-11-08, fix [#191](https://github.com/winlinvip/simple-rtmp-server/issues/191), configure --export-librtmp-project and --export-librtmp-single. 2.0.11.
* v2.0, 2014-11-08, fix [#66](https://github.com/winlinvip/simple-rtmp-server/issues/66), srs-librtmp support write h264 raw packet. 2.0.9. * v2.0, 2014-11-08, fix [#66](https://github.com/winlinvip/simple-rtmp-server/issues/66), srs-librtmp support write h264 raw packet. 2.0.9.
* v2.0, 2014-10-25, fix [#185](https://github.com/winlinvip/simple-rtmp-server/issues/185), AMF0 support 0x0B the date type codec. 2.0.7. * v2.0, 2014-10-25, fix [#185](https://github.com/winlinvip/simple-rtmp-server/issues/185), AMF0 support 0x0B the date type codec. 2.0.7.

View file

@ -170,9 +170,6 @@ int SrsEdgeIngester::ingest()
SrsPithyPrint pithy_print(SRS_CONSTS_STAGE_EDGE); SrsPithyPrint pithy_print(SRS_CONSTS_STAGE_EDGE);
while (pthread->can_loop()) { while (pthread->can_loop()) {
// switch to other st-threads.
st_usleep(0);
pithy_print.elapse(); pithy_print.elapse();
// pithy print // pithy print
@ -480,9 +477,6 @@ int SrsEdgeForwarder::cycle()
SrsSharedPtrMessageArray msgs(SYS_MAX_EDGE_SEND_MSGS); SrsSharedPtrMessageArray msgs(SYS_MAX_EDGE_SEND_MSGS);
while (pthread->can_loop()) { while (pthread->can_loop()) {
// switch to other st-threads.
st_usleep(0);
if (send_error_code != ERROR_SUCCESS) { if (send_error_code != ERROR_SUCCESS) {
st_usleep(SRS_EDGE_FORWARDER_ERROR_US); st_usleep(SRS_EDGE_FORWARDER_ERROR_US);
continue; continue;

View file

@ -399,9 +399,6 @@ int SrsForwarder::forward()
} }
while (pthread->can_loop()) { while (pthread->can_loop()) {
// switch to other st-threads.
st_usleep(0);
pithy_print.elapse(); pithy_print.elapse();
// read from client. // read from client.

View file

@ -608,9 +608,6 @@ int SrsRtmpConn::playing(SrsSource* source)
return ret; return ret;
} }
} }
// switch to other threads, to anti dead loop.
st_usleep(0);
} }
return ret; return ret;
@ -668,9 +665,6 @@ int SrsRtmpConn::do_fmle_publishing(SrsSource* source)
} }
while (true) { while (true) {
// switch to other st-threads.
st_usleep(0);
SrsMessage* msg = NULL; SrsMessage* msg = NULL;
if ((ret = rtmp->recv_message(&msg)) != ERROR_SUCCESS) { if ((ret = rtmp->recv_message(&msg)) != ERROR_SUCCESS) {
srs_error("fmle recv identify client message failed. ret=%d", ret); srs_error("fmle recv identify client message failed. ret=%d", ret);
@ -774,9 +768,6 @@ int SrsRtmpConn::do_flash_publishing(SrsSource* source)
} }
while (true) { while (true) {
// switch to other st-threads.
st_usleep(0);
SrsMessage* msg = NULL; SrsMessage* msg = NULL;
if ((ret = rtmp->recv_message(&msg)) != ERROR_SUCCESS) { if ((ret = rtmp->recv_message(&msg)) != ERROR_SUCCESS) {
if (!srs_is_client_gracefully_close(ret)) { if (!srs_is_client_gracefully_close(ret)) {

View file

@ -50,14 +50,12 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* espectially on st_usleep(), so the cycle must check the loop, * espectially on st_usleep(), so the cycle must check the loop,
* when handler->cycle() has loop itself, for example: * when handler->cycle() has loop itself, for example:
* while (true): * while (true):
* st_usleep(0);
* if (read_from_socket(skt) < 0) break; * if (read_from_socket(skt) < 0) break;
* if thread stop when read_from_socket, it's ok, the loop will break, * if thread stop when read_from_socket, it's ok, the loop will break,
* but when thread stop interrupt the s_usleep(0), then the loop is * but when thread stop interrupt the s_usleep(0), then the loop is
* death loop. * death loop.
* in a word, the handler->cycle() must: * in a word, the handler->cycle() must:
* while (pthread->can_loop()): * while (pthread->can_loop()):
* st_usleep(0);
* if (read_from_socket(skt) < 0) break; * if (read_from_socket(skt) < 0) break;
* check the loop, then it works. * check the loop, then it works.
* *

View file

@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// current release version // current release version
#define VERSION_MAJOR 2 #define VERSION_MAJOR 2
#define VERSION_MINOR 0 #define VERSION_MINOR 0
#define VERSION_REVISION 12 #define VERSION_REVISION 13
// server info. // server info.
#define RTMP_SIG_SRS_KEY "SRS" #define RTMP_SIG_SRS_KEY "SRS"
#define RTMP_SIG_SRS_ROLE "origin/edge server" #define RTMP_SIG_SRS_ROLE "origin/edge server"