mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
ST: Support set context id while thread running. v5.0.72
This commit is contained in:
parent
9525511032
commit
dc20d5ddbc
12 changed files with 96 additions and 15 deletions
|
@ -66,7 +66,12 @@ srs_error_t SrsDummyCoroutine::pull()
|
|||
|
||||
const SrsContextId& SrsDummyCoroutine::cid()
|
||||
{
|
||||
return _srs_context->get_id();
|
||||
return cid_;
|
||||
}
|
||||
|
||||
void SrsDummyCoroutine::set_cid(const SrsContextId& cid)
|
||||
{
|
||||
cid_ = cid;
|
||||
}
|
||||
|
||||
SrsSTCoroutine::SrsSTCoroutine(string n, ISrsCoroutineHandler* h)
|
||||
|
@ -114,6 +119,11 @@ const SrsContextId& SrsSTCoroutine::cid()
|
|||
return impl_->cid();
|
||||
}
|
||||
|
||||
void SrsSTCoroutine::set_cid(const SrsContextId& cid)
|
||||
{
|
||||
impl_->set_cid(cid);
|
||||
}
|
||||
|
||||
SrsFastCoroutine::SrsFastCoroutine(string n, ISrsCoroutineHandler* h)
|
||||
{
|
||||
// TODO: FIXME: Reduce duplicated code.
|
||||
|
@ -257,6 +267,12 @@ const SrsContextId& SrsFastCoroutine::cid()
|
|||
return cid_;
|
||||
}
|
||||
|
||||
void SrsFastCoroutine::set_cid(const SrsContextId& cid)
|
||||
{
|
||||
cid_ = cid;
|
||||
srs_context_set_cid_of(trd, cid);
|
||||
}
|
||||
|
||||
srs_error_t SrsFastCoroutine::cycle()
|
||||
{
|
||||
if (_srs_context) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue