mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-10-31 00:37:39 +08:00
fix: WebRtcTransport 切换 poller 线程时,创建 WebRtcSession 不需要加锁
This commit is contained in:
parent
bc4fa2bc53
commit
59ecdd13e5
@ -68,7 +68,7 @@ void WebRtcSession::onRecv_l(const char *data, size_t len) {
|
|||||||
|
|
||||||
//WebRtcTransport在其他poller线程上,需要切换poller线程并重新创建WebRtcSession对象
|
//WebRtcTransport在其他poller线程上,需要切换poller线程并重新创建WebRtcSession对象
|
||||||
if (!transport->getPoller()->isCurrentThread()) {
|
if (!transport->getPoller()->isCurrentThread()) {
|
||||||
auto sock = Socket::createSocket(transport->getPoller());
|
auto sock = Socket::createSocket(transport->getPoller(), false);
|
||||||
//1、克隆socket(fd不变),切换poller线程到WebRtcTransport所在线程
|
//1、克隆socket(fd不变),切换poller线程到WebRtcTransport所在线程
|
||||||
sock->cloneFromPeerSocket(*(getSock()));
|
sock->cloneFromPeerSocket(*(getSock()));
|
||||||
auto server = _server;
|
auto server = _server;
|
||||||
|
Loading…
Reference in New Issue
Block a user