mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 00:41:02 +00:00
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:
parent
69c370dcdc
commit
e14023c539
1 changed files with 4 additions and 0 deletions
|
@ -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",
|
||||
|
|
Loading…
Reference in a new issue