зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1521304: Move some Mutexes r=tuexen,dminor
This commit is contained in:
Родитель
7e2ceb9259
Коммит
f3e7d33519
|
@ -2312,13 +2312,22 @@ int DataChannelConnection::ReceiveCallback(struct socket *sock, void *data,
|
|||
|
||||
if (!data) {
|
||||
LOG(("ReceiveCallback: SCTP has finished shutting down"));
|
||||
} else {
|
||||
bool locked = false;
|
||||
if (!IsSTSThread()) {
|
||||
mLock.Lock();
|
||||
locked = true;
|
||||
} else {
|
||||
mLock.AssertCurrentThreadOwns();
|
||||
}
|
||||
if (flags & MSG_NOTIFICATION) {
|
||||
HandleNotification(static_cast<union sctp_notification *>(data), datalen);
|
||||
} else {
|
||||
HandleMessage(data, datalen, ntohl(rcv.rcv_ppid), rcv.rcv_sid, flags);
|
||||
}
|
||||
if (locked) {
|
||||
mLock.Unlock();
|
||||
}
|
||||
}
|
||||
// sctp allocates 'data' with malloc(), and expects the receiver to free
|
||||
// it (presumably with free).
|
||||
|
|
Загрузка…
Ссылка в новой задаче