Minor tidyups

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@22058 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-Macdonald 2005-11-21 13:15:39 +00:00
parent 12a7d91d77
commit 0814e1b8ad
4 changed files with 29 additions and 10 deletions

View file

@ -94,6 +94,9 @@ GS_EXPORT NSString* const NSConnectionProxyCount; /* Objects received */
BOOL _authenticateIn;
BOOL _authenticateOut;
BOOL _multipleThreads;
BOOL _shuttingDown;
BOOL _dummy1;
BOOL _dummy2;
NSPort *_receivePort;
NSPort *_sendPort;
unsigned _requestDepth;

View file

@ -217,6 +217,7 @@ stringFromMsgType(int type)
- (void) _service_rootObject: (NSPortCoder*)rmc;
- (void) _service_shutdown: (NSPortCoder*)rmc;
- (void) _service_typeForSelector: (NSPortCoder*)rmc;
- (void) _shutdown;
+ (void) _threadWillExit: (NSNotification*)notification;
@end
@ -1014,6 +1015,15 @@ static NSLock *cached_proxies_gate = nil;
M_UNLOCK(_refGate);
return;
}
if (_shuttingDown == NO)
{
_shuttingDown = YES;
/*
* Not invalidated as a result of a shutdown from the other end,
* so tell the other end it must shut down.
*/
//[self _shutdown];
}
_isValid = NO;
M_LOCK(connection_table_gate);
NSHashRemove(connection_table, self);
@ -2587,24 +2597,28 @@ static void callEncoder (DOContext *ctxt)
[self _sendOutRmc: op type: RETAIN_REPLY];
}
- (void) shutdown
- (void) _shutdown
{
NSPortCoder *op;
int sno;
NSParameterAssert(_receivePort);
NSParameterAssert (_isValid);
op = [self _makeOutRmc: 0 generate: &sno reply: NO];
[self _sendOutRmc: op type: CONNECTION_SHUTDOWN];
NS_DURING
{
NSPortCoder *op;
int sno;
op = [self _makeOutRmc: 0 generate: &sno reply: NO];
[self _sendOutRmc: op type: CONNECTION_SHUTDOWN];
}
NS_HANDLER
NS_ENDHANDLER
}
- (void) _service_shutdown: (NSPortCoder*)rmc
{
NSParameterAssert (_isValid);
_shuttingDown = YES; // Prevent shutdown being sent back to other end
[self _doneInRmc: rmc];
[self invalidate];
[NSException raise: NSGenericException
format: @"connection waiting for request was shut down"];
}
- (void) _service_typeForSelector: (NSPortCoder*)rmc

View file

@ -32,7 +32,7 @@
* in the server ... we expect the info from the server to be used.
*/
@interface Dummy : NSObject
- (id) quietBycopy: (id byref)a;
- (id) quietBycopy: (byref id)a;
@end
@interface CallbackClient : NSObject <ClientProtocol>
@ -639,6 +639,8 @@ int main (int argc, char *argv[], char **env)
if (stats)
con_statistics (prx);
[cobj invalidate];
[arp release];
return 0;
}

View file

@ -412,7 +412,7 @@
- connectionBecameInvalid: notification
{
id anObj = [notification object];
if ([anObj isKindOf:[NSConnection class]])
if ([anObj isKindOfClass: [NSConnection class]])
{
int i, count = [the_array count];
for (i = count-1; i >= 0; i--)