patch to improve thread startup by Larry Campbell

This commit is contained in:
rfm 2024-01-29 19:50:44 +00:00
parent 1cf38dee99
commit 41d948b5bb
2 changed files with 6 additions and 5 deletions

View file

@ -1112,17 +1112,13 @@ static NSOperationQueue *mainQueue = nil;
}
else
{
NSUInteger pending;
[internal->cond lock];
pending = [internal->starting count];
[internal->starting addObject: op];
/* Create a new thread if all existing threads are busy and
* we haven't reached the pool limit.
*/
if (0 == internal->threadCount
|| (pending > 0 && internal->threadCount < max))
if (internal->threadCount < max)
{
internal->threadCount++;
NS_DURING