([Connection +initialize]): Initialize all_connections_local_targets.

([Connection -addLocalObject:]): Put it in all_connections_local_targets
also.
([Connection -removeLocalObject:]): Remove it from
all_connections_local_targets also.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1081 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
mccallum 1996-03-06 16:40:00 +00:00
parent ad7c8a4a55
commit fd0733d23d

View file

@ -129,6 +129,10 @@ static int messages_received_count;
{
connection_array = [[Array alloc] init];
connection_array_gate = [Lock new];
/* xxx When NSHashTable's are working, change this. */
all_connections_local_targets =
NSCreateMapTable (NSNonOwnedPointerMapKeyCallBacks,
NSNonOwnedPointerMapValueCallBacks, 0);
received_request_rmc_queue = [[Queue alloc] init];
received_request_rmc_queue_gate = [Lock new];
received_reply_rmc_queue = [[Queue alloc] init];
@ -952,6 +956,17 @@ static int messages_received_count;
/* Managing objects and proxies. */
- (void) addLocalObject: anObj
{
[proxiesHashGate lock];
/* xxx Do we need to check to make sure it's not already there? */
/* This retains anObj. */
NSMapInsert (local_targets, (void*)anObj, anObj);
/* This does not retain anObj. */
NSMapInsert (all_connections_local_targets, (void*)anObj, anObj);
[proxiesHashGate unlock];
}
/* This should get called whenever an object free's itself */
+ (void) removeLocalObject: anObj
{
@ -970,6 +985,7 @@ static int messages_received_count;
[proxiesHashGate lock];
/* This also releases anObj */
NSMapRemove (local_targets, (void*)anObj);
NSMapRemove (all_connections_local_targets, (void*)anObj);
[proxiesHashGate unlock];
}
@ -1025,15 +1041,6 @@ static int messages_received_count;
[proxiesHashGate unlock];
}
- (void) addLocalObject: anObj
{
[proxiesHashGate lock];
/* xxx Do we need to check to make sure it's not already there? */
/* This retains anObj */
NSMapInsert (local_targets, (void*)anObj, anObj);
[proxiesHashGate unlock];
}
- (BOOL) includesProxyForTarget: (unsigned)target
{
BOOL ret;