Report whether pool is suspended

This commit is contained in:
Richard Frith-Macdonald 2022-08-24 11:31:11 +01:00
parent 09dfc1c403
commit 633c3a6da7
2 changed files with 6 additions and 4 deletions

View file

@ -54,7 +54,7 @@
/** Returns an instance intended for sharing between sections of code which
* wish to make use of threading by performing operations in other threads,
* but which don't mind operations being interleaved with those belonging to
* oither sections of code.<br />
* other sections of code.<br />
* Always returns the same instance whenever the method is called.
*/
+ (GSThreadPool*) sharedPool;

View file

@ -128,9 +128,11 @@ static GSThreadPool *shared = nil;
result = [NSString stringWithFormat:
@"%@ %@ queue: %"PRIuPTR"(%"PRIuPTR")"
@" threads: %"PRIuPTR"(%"PRIuPTR")"
@" active: %"PRIuPTR" processed: %"PRIuPTR"",
@" active: %"PRIuPTR" processed: %"PRIuPTR""
@" suspended: %s",
[super description], poolName, operations->count, maxOperations,
idle->count + live->count, maxThreads, live->count, processed];
idle->count + live->count, maxThreads, live->count, processed,
(suspended ? "yes" : "no")];
[poolLock unlock];
return result;
}
@ -507,7 +509,7 @@ static GSThreadPool *shared = nil;
#if !defined (GNUSTEP) && (MAC_OS_X_VERSION_MAX_ALLOWED<=MAC_OS_X_VERSION_10_4)
/* With the older thread API we must set up the link item *after* the
* thread starts. With the new API this is not needed as we cans set
* thread starts. With the new API this is not needed as we can set
* things up and then start the thread.
*/
[link setItem: [NSThread currentThread]];