From 633c3a6da7b76a70a79c5162dd5b4f99d9ba8b58 Mon Sep 17 00:00:00 2001 From: Richard Frith-Macdonald Date: Wed, 24 Aug 2022 11:31:11 +0100 Subject: [PATCH] Report whether pool is suspended --- GSThreadPool.h | 2 +- GSThreadPool.m | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/GSThreadPool.h b/GSThreadPool.h index b5c45c1..898caa6 100644 --- a/GSThreadPool.h +++ b/GSThreadPool.h @@ -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.
+ * other sections of code.
* Always returns the same instance whenever the method is called. */ + (GSThreadPool*) sharedPool; diff --git a/GSThreadPool.m b/GSThreadPool.m index c71c21a..c5ecbc6 100644 --- a/GSThreadPool.m +++ b/GSThreadPool.m @@ -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]];