From 66201ea20070376b76325f24ac40835aea48e6c8 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Tue, 22 Oct 2024 01:30:39 -0400 Subject: mp_pool_show_summary now prints "HOLD" when queued tasks haven't been executed and the pool is killed --- src/lib/core/multiprocessing.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/lib/core/multiprocessing.c b/src/lib/core/multiprocessing.c index 29ea6b0..252bab9 100644 --- a/src/lib/core/multiprocessing.c +++ b/src/lib/core/multiprocessing.c @@ -169,7 +169,13 @@ void mp_pool_show_summary(struct MultiProcessingPool *pool) { for (size_t i = 0; i < pool->num_used; i++) { struct MultiProcessingTask *task = &pool->task[i]; char status_str[10] = {0}; - if (!task->status && !task->signaled_by) { + + if (task->status == MP_POOL_TASK_STATUS_INITIAL && task->pid == MP_POOL_PID_UNUSED) { + // You will only see this label if the task pool is killed by + // MP_POOL_FAIL_FAST and tasks are still queued for execution + strcpy(status_str, "HOLD"); + } else if (!task->status && !task->signaled_by) { + strcpy(status_str, "DONE"); } else if (task->signaled_by) { strcpy(status_str, "TERM"); -- cgit