mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-21 04:32: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
|
@ -1,5 +1,11 @@
|
||||||
2002-09-19 Richard Frith-Macdonald <rfm@gnu.org>
|
2002-09-19 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
|
* Source/GSTcpHandle.m: Check port for invalidation while looping
|
||||||
|
on write events, so we can fail if we become invalid while sending
|
||||||
|
or connecting, before the port timeout expires.
|
||||||
|
* Source/NSConnection.m: Check connection for invalidation while
|
||||||
|
looping waiting for a reply, so we can fail if we become invalid
|
||||||
|
before the timeout expires.
|
||||||
* Source/DocMakefile: Specify template options
|
* Source/DocMakefile: Specify template options
|
||||||
* Tools/autogsdoc.m: Remove hack to turn templates on by default.
|
* Tools/autogsdoc.m: Remove hack to turn templates on by default.
|
||||||
Document the use of templates.
|
Document the use of templates.
|
||||||
|
|
|
@ -556,7 +556,8 @@ static Class runLoopClass;
|
||||||
type: ET_EDESC
|
type: ET_EDESC
|
||||||
watcher: self
|
watcher: self
|
||||||
forMode: NSConnectionReplyMode];
|
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];
|
[l runMode: NSConnectionReplyMode beforeDate: when];
|
||||||
}
|
}
|
||||||
|
@ -1154,6 +1155,10 @@ static Class runLoopClass;
|
||||||
type: ET_WDESC
|
type: ET_WDESC
|
||||||
forMode: mode
|
forMode: mode
|
||||||
all: NO];
|
all: NO];
|
||||||
|
[l removeEvent: data
|
||||||
|
type: ET_EDESC
|
||||||
|
forMode: mode
|
||||||
|
all: NO];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1183,7 +1188,8 @@ static Class runLoopClass;
|
||||||
type: ET_WDESC
|
type: ET_WDESC
|
||||||
watcher: self
|
watcher: self
|
||||||
forMode: NSConnectionReplyMode];
|
forMode: NSConnectionReplyMode];
|
||||||
while ([wMsgs indexOfObjectIdenticalTo: components] != NSNotFound
|
while (valid == YES
|
||||||
|
&& [wMsgs indexOfObjectIdenticalTo: components] != NSNotFound
|
||||||
&& [when timeIntervalSinceNow] > 0)
|
&& [when timeIntervalSinceNow] > 0)
|
||||||
{
|
{
|
||||||
DO_UNLOCK(myLock);
|
DO_UNLOCK(myLock);
|
||||||
|
|
|
@ -2655,7 +2655,7 @@ static void callEncoder (DOContext *ctxt)
|
||||||
- _getReplyRmc: (int)sn
|
- _getReplyRmc: (int)sn
|
||||||
{
|
{
|
||||||
NSPortCoder *rmc;
|
NSPortCoder *rmc;
|
||||||
GSIMapNode node;
|
GSIMapNode node = 0;
|
||||||
NSDate *timeout_date = nil;
|
NSDate *timeout_date = nil;
|
||||||
NSTimeInterval last_interval = 0.0001;
|
NSTimeInterval last_interval = 0.0001;
|
||||||
NSTimeInterval delay_interval = last_interval;
|
NSTimeInterval delay_interval = last_interval;
|
||||||
|
@ -2666,7 +2666,8 @@ static void callEncoder (DOContext *ctxt)
|
||||||
NSLog(@"Waiting for reply sequence %d on %x:%x",
|
NSLog(@"Waiting for reply sequence %d on %x:%x",
|
||||||
sn, self, [NSThread currentThread]);
|
sn, self, [NSThread currentThread]);
|
||||||
M_LOCK(_queueGate);
|
M_LOCK(_queueGate);
|
||||||
while ((node = GSIMapNodeForKey(_replyMap, (GSIMapKey)sn)) != 0
|
while (_isValid == YES
|
||||||
|
&& (node = GSIMapNodeForKey(_replyMap, (GSIMapKey)sn)) != 0
|
||||||
&& node->value.obj == dummyObject)
|
&& node->value.obj == dummyObject)
|
||||||
{
|
{
|
||||||
M_UNLOCK(_queueGate);
|
M_UNLOCK(_queueGate);
|
||||||
|
@ -2764,10 +2765,18 @@ static void callEncoder (DOContext *ctxt)
|
||||||
format: @"no reply message available"];
|
format: @"no reply message available"];
|
||||||
}
|
}
|
||||||
if (rmc == dummyObject)
|
if (rmc == dummyObject)
|
||||||
|
{
|
||||||
|
if (_isValid == YES)
|
||||||
{
|
{
|
||||||
[NSException raise: NSPortTimeoutException
|
[NSException raise: NSPortTimeoutException
|
||||||
format: @"timed out waiting for reply"];
|
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);
|
NSDebugMLLog(@"NSConnection", @"Consuming reply RMC %d on %x", sn, self);
|
||||||
return rmc;
|
return rmc;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue