mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
For #913, coroutine support complex error.
This commit is contained in:
parent
9ae54850bf
commit
9db2a04c3b
38 changed files with 620 additions and 414 deletions
|
@ -43,19 +43,31 @@ SrsCoroutineManager::~SrsCoroutineManager()
|
|||
clear();
|
||||
}
|
||||
|
||||
int SrsCoroutineManager::start()
|
||||
srs_error_t SrsCoroutineManager::start()
|
||||
{
|
||||
return trd->start();
|
||||
srs_error_t err = srs_success;
|
||||
|
||||
if ((err = trd->start()) != srs_success) {
|
||||
return srs_error_wrap(err, "coroutine manager");
|
||||
}
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
int SrsCoroutineManager::cycle()
|
||||
srs_error_t SrsCoroutineManager::cycle()
|
||||
{
|
||||
while (!trd->pull()) {
|
||||
srs_error_t err = srs_success;
|
||||
|
||||
while (true) {
|
||||
if ((err = trd->pull()) != srs_success) {
|
||||
return srs_error_wrap(err, "coroutine mansger");
|
||||
}
|
||||
|
||||
srs_cond_wait(cond);
|
||||
clear();
|
||||
}
|
||||
|
||||
return ERROR_SUCCESS;
|
||||
return err;
|
||||
}
|
||||
|
||||
void SrsCoroutineManager::remove(ISrsConnection* c)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue