mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 16:30:41 +00:00
locking tweak
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@31210 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
3b4e148c19
commit
e8ed721622
1 changed files with 10 additions and 4 deletions
|
@ -919,11 +919,17 @@ static void *nsthreadLauncher(void* thread)
|
|||
NSLog(@"Set event failed - %@", [NSError _last]);
|
||||
}
|
||||
#else
|
||||
/* The write could concievably fail if the pipe is full, but in that
|
||||
* case we don't care since the other thread should be woken to handle
|
||||
* reading anyway.
|
||||
/* The write could concievably fail if the pipe is full.
|
||||
* In that case we need to release the lock teporarily to allow the other
|
||||
* thread to consume data from the pipe. It's possible that the thread
|
||||
* and its runloop might stop during that ... so we need to check that
|
||||
* outputFd is still valid.
|
||||
*/
|
||||
write(outputFd, "0", 1);
|
||||
while (outputFd >= 0 && write(outputFd, "0", 1) != 1)
|
||||
{
|
||||
[lock unlock];
|
||||
[lock lock];
|
||||
}
|
||||
#endif
|
||||
[lock unlock];
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue