Thread safety fix

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@23445 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
rfm 2006-09-10 10:47:50 +00:00
parent e3532b5295
commit bdf6b69bce
3 changed files with 62 additions and 15 deletions

View file

@ -1574,14 +1574,14 @@ typedef struct {
unsigned i;
M_LOCK(messagePortLock);
NSMapRemove(messagePortMap, (void*)name);
M_UNLOCK(messagePortLock);
if (lDesc >= 0)
{
(void) close(lDesc);
unlink([name bytes]);
lDesc = -1;
}
NSMapRemove(messagePortMap, (void*)name);
M_UNLOCK(messagePortLock);
if (handles != 0)
{
@ -1691,6 +1691,21 @@ typedef struct {
}
}
- (void) release
{
M_LOCK(messagePortLock);
if (NSDecrementExtraRefCountWasZero(self))
{
NSMapRemove(messagePortMap, (void*)name);
M_UNLOCK(messagePortLock);
[self dealloc];
}
else
{
M_UNLOCK(messagePortLock);
}
}
- (void) removeHandle: (GSMessageHandle*)handle
{
M_LOCK(myLock);