mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 16:50:58 +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
1bf97bc92e
commit
cc3838db4d
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>
|
2009-05-23 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
* Source/NSKeyValueObserving.m:
|
* Source/NSKeyValueObserving.m:
|
||||||
|
|
|
@ -1057,7 +1057,12 @@ GSRunLoopInfoForThread(NSThread *aThread)
|
||||||
}
|
}
|
||||||
if (((NSThread_ivars*)aThread)->_runLoopInfo == nil)
|
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;
|
info = ((NSThread_ivars*)aThread)->_runLoopInfo;
|
||||||
return info;
|
return info;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue