1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

refine the thread, add all callback.

This commit is contained in:
winlin 2015-05-23 09:49:15 +08:00
parent e5f449ce36
commit cfc0877ec9
9 changed files with 341 additions and 57 deletions

View file

@ -50,7 +50,7 @@ SrsRecvThread::SrsRecvThread(ISrsMessageHandler* msg_handler, SrsRtmpServer* rtm
timeout = timeout_ms;
handler = msg_handler;
rtmp = rtmp_sdk;
trd = new SrsReusableThread("recv", this);
trd = new SrsReusableThread2("recv", this);
}
SrsRecvThread::~SrsRecvThread()
@ -72,6 +72,11 @@ void SrsRecvThread::stop()
trd->stop();
}
void SrsRecvThread::stop_loop()
{
trd->interrupt();
}
int SrsRecvThread::cycle()
{
int ret = ERROR_SUCCESS;
@ -109,11 +114,6 @@ int SrsRecvThread::cycle()
return ret;
}
void SrsRecvThread::stop_loop()
{
trd->interrupt();
}
void SrsRecvThread::on_thread_start()
{
// the multiple messages writev improve performance large,