mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 08:21:25 +00:00
Changes to avoid possible hang in connection reply mode due to race condition.
This commit is contained in:
parent
38fc2bde82
commit
4ce7a25541
5 changed files with 209 additions and 224 deletions
|
@ -909,10 +909,6 @@ again:
|
|||
{
|
||||
NSDebugMLLog(@"NSMessagePort",
|
||||
@"got event on invalidated port 0x%x in mode %@", self, mode);
|
||||
[[NSRunLoop currentRunLoop] removeEvent: data
|
||||
type: type
|
||||
forMode: mode
|
||||
all: YES];
|
||||
}
|
||||
RELEASE(self);
|
||||
}
|
||||
|
@ -1109,7 +1105,21 @@ again:
|
|||
&& [when timeIntervalSinceNow] > 0)
|
||||
{
|
||||
M_UNLOCK(this->lock);
|
||||
[loop runMode: NSConnectionReplyMode beforeDate: when];
|
||||
NS_DURING
|
||||
[loop runMode: NSConnectionReplyMode beforeDate: when];
|
||||
NS_HANDLER
|
||||
M_LOCK(this->lock);
|
||||
[loop removeEvent: (void*)(uintptr_t)this->wEvent
|
||||
type: ET_HANDLE
|
||||
forMode: NSConnectionReplyMode
|
||||
all: NO];
|
||||
[loop removeEvent: (void*)(uintptr_t)this->wEvent
|
||||
type: ET_HANDLE
|
||||
forMode: NSDefaultRunLoopMode
|
||||
all: NO];
|
||||
M_UNLOCK(this->lock);
|
||||
[localException raise];
|
||||
NS_ENDHANDLER
|
||||
M_LOCK(this->lock);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue