mirror of
https://github.com/gnustep/libs-performance.git
synced 2025-02-19 18:11:16 +00:00
fix segfault when no threads are configuredb ... should use main thread.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/performance/trunk@36752 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
b987200256
commit
4782d743ed
1 changed files with 6 additions and 1 deletions
|
@ -145,8 +145,13 @@ best(NSMutableArray *a)
|
|||
GSIOThread *t;
|
||||
|
||||
[poolLock lock];
|
||||
if (0 == maxThreads)
|
||||
{
|
||||
[poolLock unlock];
|
||||
return [NSThread mainThread];
|
||||
}
|
||||
t = best(threads);
|
||||
if (t->count > 0 && [threads count] < maxThreads)
|
||||
if (nil == t || (t->count > 0 && [threads count] < maxThreads))
|
||||
{
|
||||
t = [GSIOThread new];
|
||||
[threads addObject: t];
|
||||
|
|
Loading…
Reference in a new issue