mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 08:41:03 +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
|
@ -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