diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2024-10-22 01:30:39 -0400 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2024-10-22 01:30:39 -0400 |
commit | 66201ea20070376b76325f24ac40835aea48e6c8 (patch) | |
tree | a19e1e6b353ca34abb8a778337694968eaecbcad /src | |
parent | 261a8251150268aa2dd1d24044db281a70af2c86 (diff) | |
download | stasis-66201ea20070376b76325f24ac40835aea48e6c8.tar.gz |
mp_pool_show_summary now prints "HOLD" when queued tasks haven't been executed and the pool is killed
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/core/multiprocessing.c | 8 |
1 files changed, 7 insertions, 1 deletions
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"); |