mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-23 03:10:04 +08:00
修复一个可能导致死锁的bug
This commit is contained in:
parent
823d887b17
commit
62d56ff395
@ -73,9 +73,12 @@ MediaSource::Ptr MediaSource::find(
|
|||||||
}
|
}
|
||||||
bool MediaSource::regist() {
|
bool MediaSource::regist() {
|
||||||
//注册该源,注册后服务器才能找到该源
|
//注册该源,注册后服务器才能找到该源
|
||||||
|
bool success;
|
||||||
|
{
|
||||||
lock_guard<recursive_mutex> lock(g_mtxMediaSrc);
|
lock_guard<recursive_mutex> lock(g_mtxMediaSrc);
|
||||||
auto pr = g_mapMediaSrc[_strSchema][_strVhost][_strApp].emplace(_strId,shared_from_this());
|
auto pr = g_mapMediaSrc[_strSchema][_strVhost][_strApp].emplace(_strId, shared_from_this());
|
||||||
auto success = pr.second;
|
success = pr.second;
|
||||||
|
}
|
||||||
if(success){
|
if(success){
|
||||||
InfoL << _strSchema << " " << _strVhost << " " << _strApp << " " << _strId;
|
InfoL << _strSchema << " " << _strVhost << " " << _strApp << " " << _strId;
|
||||||
NoticeCenter::Instance().emitEvent(Broadcast::kBroadcastMediaChanged,
|
NoticeCenter::Instance().emitEvent(Broadcast::kBroadcastMediaChanged,
|
||||||
|
Loading…
Reference in New Issue
Block a user