mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-29 16:01:38 +00:00
Fixes for occasional possible hangups.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@14489 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
8acf356afb
commit
a20d698ce9
3 changed files with 27 additions and 6 deletions
|
@ -556,7 +556,8 @@ static Class runLoopClass;
|
|||
type: ET_EDESC
|
||||
watcher: self
|
||||
forMode: NSConnectionReplyMode];
|
||||
while (state == GS_H_TRYCON && [when timeIntervalSinceNow] > 0)
|
||||
while (valid == YES && state == GS_H_TRYCON
|
||||
&& [when timeIntervalSinceNow] > 0)
|
||||
{
|
||||
[l runMode: NSConnectionReplyMode beforeDate: when];
|
||||
}
|
||||
|
@ -1154,6 +1155,10 @@ static Class runLoopClass;
|
|||
type: ET_WDESC
|
||||
forMode: mode
|
||||
all: NO];
|
||||
[l removeEvent: data
|
||||
type: ET_EDESC
|
||||
forMode: mode
|
||||
all: NO];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1183,7 +1188,8 @@ static Class runLoopClass;
|
|||
type: ET_WDESC
|
||||
watcher: self
|
||||
forMode: NSConnectionReplyMode];
|
||||
while ([wMsgs indexOfObjectIdenticalTo: components] != NSNotFound
|
||||
while (valid == YES
|
||||
&& [wMsgs indexOfObjectIdenticalTo: components] != NSNotFound
|
||||
&& [when timeIntervalSinceNow] > 0)
|
||||
{
|
||||
DO_UNLOCK(myLock);
|
||||
|
|
|
@ -2655,7 +2655,7 @@ static void callEncoder (DOContext *ctxt)
|
|||
- _getReplyRmc: (int)sn
|
||||
{
|
||||
NSPortCoder *rmc;
|
||||
GSIMapNode node;
|
||||
GSIMapNode node = 0;
|
||||
NSDate *timeout_date = nil;
|
||||
NSTimeInterval last_interval = 0.0001;
|
||||
NSTimeInterval delay_interval = last_interval;
|
||||
|
@ -2666,7 +2666,8 @@ static void callEncoder (DOContext *ctxt)
|
|||
NSLog(@"Waiting for reply sequence %d on %x:%x",
|
||||
sn, self, [NSThread currentThread]);
|
||||
M_LOCK(_queueGate);
|
||||
while ((node = GSIMapNodeForKey(_replyMap, (GSIMapKey)sn)) != 0
|
||||
while (_isValid == YES
|
||||
&& (node = GSIMapNodeForKey(_replyMap, (GSIMapKey)sn)) != 0
|
||||
&& node->value.obj == dummyObject)
|
||||
{
|
||||
M_UNLOCK(_queueGate);
|
||||
|
@ -2765,8 +2766,16 @@ static void callEncoder (DOContext *ctxt)
|
|||
}
|
||||
if (rmc == dummyObject)
|
||||
{
|
||||
[NSException raise: NSPortTimeoutException
|
||||
format: @"timed out waiting for reply"];
|
||||
if (_isValid == YES)
|
||||
{
|
||||
[NSException raise: NSPortTimeoutException
|
||||
format: @"timed out waiting for reply"];
|
||||
}
|
||||
else
|
||||
{
|
||||
[NSException raise: NSPortTimeoutException
|
||||
format: @"invalidated while awaiting reply"];
|
||||
}
|
||||
}
|
||||
NSDebugMLLog(@"NSConnection", @"Consuming reply RMC %d on %x", sn, self);
|
||||
return rmc;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue