From 41d948b5bb230e9aedac43c05af36bc40958aed6 Mon Sep 17 00:00:00 2001 From: rfm Date: Mon, 29 Jan 2024 19:50:44 +0000 Subject: [PATCH] patch to improve thread startup by Larry Campbell --- ChangeLog | 5 +++++ Source/NSOperation.m | 6 +----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index a19c1b9fd5..ede2fcf3fa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,12 @@ +2024-01-08 Richard Frith-Macdonald + + * Source/NSOperation.m: patch for issue #366 by Larry Campbell. + 2024-01-08 Richard Frith-Macdonald * Source/NSJSONSerialization.m: Fix for issue #365 ... don't try to create a string ending with the first half of a unicode surrogate pair. + 2024-01-08 Richard Frith-Macdonald * Source/NSNotificationCenter.m: fix for memory leak should keep the diff --git a/Source/NSOperation.m b/Source/NSOperation.m index c30dfdf363..a2d2c1244e 100644 --- a/Source/NSOperation.m +++ b/Source/NSOperation.m @@ -1112,17 +1112,13 @@ - (void) _execute } 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