зеркало из https://github.com/mozilla/pjs.git
Bug 65146. Fix deadlock potential in proxy code; remove unncessary locks from nsPipe2. r=darin,dougt; sr=brendan
This commit is contained in:
Родитель
e9e8709445
Коммит
87a35f2e41
|
@ -399,7 +399,9 @@ nsPipe::nsPipeInputStream::ReadSegments(nsWriteSegmentFun writer,
|
|||
readBufferLen = PR_MIN(readBufferLen, amt);
|
||||
while (readBufferLen > 0) {
|
||||
PRUint32 writeCount = 0;
|
||||
mon.Exit(); // XXX avoid deadlock better
|
||||
rv = writer(this, closure, readBuffer, *readCount, readBufferLen, &writeCount);
|
||||
mon.Enter();
|
||||
if (NS_FAILED(rv) && rv != NS_BASE_STREAM_WOULD_BLOCK)
|
||||
goto done;
|
||||
NS_ASSERTION(writeCount <= readBufferLen, "writer returned bad writeCount");
|
||||
|
@ -690,7 +692,9 @@ nsPipe::nsPipeOutputStream::WriteSegments(nsReadSegmentFun reader,
|
|||
writeBufLen = PR_MIN(writeBufLen, amt);
|
||||
while (writeBufLen > 0) {
|
||||
PRUint32 readCount = 0;
|
||||
mon.Exit(); // XXX avoid deadlock better
|
||||
rv = reader(this, closure, writeBuf, *writeCount, writeBufLen, &readCount);
|
||||
mon.Enter();
|
||||
if (rv == NS_BASE_STREAM_WOULD_BLOCK) {
|
||||
NS_ASSERTION(readCount <= writeBufLen, "reader returned bad readCount");
|
||||
// XXX should not update counters if reader returned WOULD_BLOCK!!
|
||||
|
|
|
@ -296,10 +296,7 @@ nsProxyObject::Release(void)
|
|||
ProxyDestructorEventHandler,
|
||||
ProxyDestructorDestroyHandler);
|
||||
|
||||
// fire it off.
|
||||
mDestQueue->PostSynchronousEvent(event, nsnull);
|
||||
|
||||
PR_DELETE(event);
|
||||
mDestQueue->PostEvent(event);
|
||||
return 0;
|
||||
}
|
||||
return mRefCnt;
|
||||
|
@ -540,5 +537,6 @@ static void* ProxyDestructorEventHandler(PLEvent *self)
|
|||
|
||||
static void ProxyDestructorDestroyHandler(PLEvent *self)
|
||||
{
|
||||
PR_DELETE(self);
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче