Double locking check added in invalidation.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@14535 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
CaS 2002-09-24 05:42:32 +00:00
parent 47851f56ed
commit cafea3d3da

View file

@ -681,6 +681,8 @@ static Class runLoopClass;
- (void) invalidate - (void) invalidate
{ {
if (valid == YES)
{
DO_LOCK(myLock); DO_LOCK(myLock);
if (valid == YES) if (valid == YES)
{ {
@ -706,6 +708,7 @@ static Class runLoopClass;
[[self sendPort] removeHandle: self]; [[self sendPort] removeHandle: self];
} }
DO_UNLOCK(myLock); DO_UNLOCK(myLock);
}
} }
- (BOOL) isValid - (BOOL) isValid
@ -1791,9 +1794,11 @@ static Class tcpPortClass;
- (void) invalidate - (void) invalidate
{ {
if ([self isValid] == YES)
{
DO_LOCK(myLock); DO_LOCK(myLock);
if ([self isValid]) if ([self isValid] == YES)
{ {
NSMapTable *thePorts; NSMapTable *thePorts;
NSArray *handleArray; NSArray *handleArray;
@ -1835,6 +1840,7 @@ static Class tcpPortClass;
[super invalidate]; [super invalidate];
} }
DO_UNLOCK(myLock); DO_UNLOCK(myLock);
}
} }
- (BOOL) isEqual: (id)anObject - (BOOL) isEqual: (id)anObject