mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
parent
b21f92f97a
commit
2ed2513f08
11 changed files with 44 additions and 212 deletions
|
@ -78,76 +78,6 @@ void SrsCoroutineManager::clear()
|
|||
}
|
||||
}
|
||||
|
||||
ISrsOneCycleThreadHandler::ISrsOneCycleThreadHandler()
|
||||
{
|
||||
}
|
||||
|
||||
ISrsOneCycleThreadHandler::~ISrsOneCycleThreadHandler()
|
||||
{
|
||||
}
|
||||
|
||||
void ISrsOneCycleThreadHandler::on_thread_start()
|
||||
{
|
||||
}
|
||||
|
||||
int ISrsOneCycleThreadHandler::on_before_cycle()
|
||||
{
|
||||
return ERROR_SUCCESS;
|
||||
}
|
||||
|
||||
int ISrsOneCycleThreadHandler::on_end_cycle()
|
||||
{
|
||||
return ERROR_SUCCESS;
|
||||
}
|
||||
|
||||
void ISrsOneCycleThreadHandler::on_thread_stop()
|
||||
{
|
||||
}
|
||||
|
||||
SrsOneCycleThread::SrsOneCycleThread(const char* n, ISrsOneCycleThreadHandler* h)
|
||||
{
|
||||
handler = h;
|
||||
pthread = new internal::SrsThread(n, this, 0, false);
|
||||
}
|
||||
|
||||
SrsOneCycleThread::~SrsOneCycleThread()
|
||||
{
|
||||
pthread->stop();
|
||||
srs_freep(pthread);
|
||||
}
|
||||
|
||||
int SrsOneCycleThread::start()
|
||||
{
|
||||
return pthread->start();
|
||||
}
|
||||
|
||||
int SrsOneCycleThread::cycle()
|
||||
{
|
||||
int ret = handler->cycle();
|
||||
pthread->stop_loop();
|
||||
return ret;
|
||||
}
|
||||
|
||||
void SrsOneCycleThread::on_thread_start()
|
||||
{
|
||||
handler->on_thread_start();
|
||||
}
|
||||
|
||||
int SrsOneCycleThread::on_before_cycle()
|
||||
{
|
||||
return handler->on_before_cycle();
|
||||
}
|
||||
|
||||
int SrsOneCycleThread::on_end_cycle()
|
||||
{
|
||||
return handler->on_end_cycle();
|
||||
}
|
||||
|
||||
void SrsOneCycleThread::on_thread_stop()
|
||||
{
|
||||
handler->on_thread_stop();
|
||||
}
|
||||
|
||||
ISrsReusableThreadHandler::ISrsReusableThreadHandler()
|
||||
{
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue