mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 00:41:02 +00:00
Fix race condition
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@28298 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
1d8d31ddcd
commit
8904aada4f
2 changed files with 11 additions and 1 deletions
|
@ -1,3 +1,8 @@
|
|||
2009-05-24 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Source/NSThread.m: Use lock to prevent race condition setting up
|
||||
runloop info for thread.
|
||||
|
||||
2009-05-23 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Source/NSKeyValueObserving.m:
|
||||
|
|
|
@ -1057,7 +1057,12 @@ GSRunLoopInfoForThread(NSThread *aThread)
|
|||
}
|
||||
if (((NSThread_ivars*)aThread)->_runLoopInfo == nil)
|
||||
{
|
||||
((NSThread_ivars*)aThread)->_runLoopInfo = [GSRunLoopThreadInfo new];
|
||||
[gnustep_global_lock lock];
|
||||
if (((NSThread_ivars*)aThread)->_runLoopInfo == nil)
|
||||
{
|
||||
((NSThread_ivars*)aThread)->_runLoopInfo = [GSRunLoopThreadInfo new];
|
||||
}
|
||||
[gnustep_global_lock unlock];
|
||||
}
|
||||
info = ((NSThread_ivars*)aThread)->_runLoopInfo;
|
||||
return info;
|
||||
|
|
Loading…
Reference in a new issue