mirror of
https://github.com/ossrs/srs.git
synced 2025-02-15 04:42:04 +00:00
for bug #237, never sleep when thread interval is 0.
This commit is contained in:
parent
6f963b50f3
commit
24a6a723ee
2 changed files with 7 additions and 3 deletions
|
@ -129,9 +129,9 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* the publish recv thread got message and callback the source method to process message.
|
* the publish recv thread got message and callback the source method to process message.
|
||||||
* @see: https://github.com/winlinvip/simple-rtmp-server/issues/237
|
* @see: https://github.com/winlinvip/simple-rtmp-server/issues/237
|
||||||
*/
|
*/
|
||||||
class SrsPublishRecvThread : public ISrsMessageHandler
|
class SrsPublishRecvThread : public ISrsMessageHandler
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -179,7 +179,11 @@ failed:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
st_usleep(cycle_interval_us);
|
// to improve performance, donot sleep when interval is zero.
|
||||||
|
// @see: https://github.com/winlinvip/simple-rtmp-server/issues/237
|
||||||
|
if (cycle_interval_us > 0) {
|
||||||
|
st_usleep(cycle_interval_us);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
handler->on_thread_stop();
|
handler->on_thread_stop();
|
||||||
|
|
Loading…
Reference in a new issue