Lock while sending

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@8155 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2000-11-20 15:34:30 +00:00
parent 69c370dcdc
commit e14023c539

View file

@ -1123,6 +1123,7 @@ static Class runLoopClass;
NSDebugMLLog(@"GSTcpHandle",
@"Sending message 0x%x %@ on 0x%x(%d) in thread 0x%x before %@",
components, components, self, desc, GSCurrentThread(), when);
DO_LOCK(myLock);
[wMsgs addObject: components];
l = [runLoopClass currentRunLoop];
@ -1136,7 +1137,9 @@ static Class runLoopClass;
while ([wMsgs indexOfObjectIdenticalTo: components] != NSNotFound
&& [when timeIntervalSinceNow] > 0)
{
DO_UNLOCK(myLock);
[l runMode: NSDefaultRunLoopMode beforeDate: when];
DO_LOCK(myLock);
}
/*
* NB. We will remove ourself from the run loop when the message send
@ -1146,6 +1149,7 @@ static Class runLoopClass;
{
sent = YES;
}
DO_UNLOCK(myLock);
RELEASE(self);
NSDebugMLLog(@"GSTcpHandle",
@"Message send 0x%x on 0x%x in thread 0x%x status %d",