diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2024-10-22 01:29:34 -0400 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2024-10-22 01:29:34 -0400 |
commit | 261a8251150268aa2dd1d24044db281a70af2c86 (patch) | |
tree | 44f4625ec7d7d1b17f1aa6ad5a1ea92e67fdad11 /src | |
parent | a27fb62977c7a3faf9032ffbc7e6531700e30441 (diff) | |
download | stasis-261a8251150268aa2dd1d24044db281a70af2c86.tar.gz |
Add MP_POOL_TASK_STATUS_INITIAL
* Better than putting -1 everywhere
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/core/multiprocessing.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/core/multiprocessing.c b/src/lib/core/multiprocessing.c index 484c566..29ea6b0 100644 --- a/src/lib/core/multiprocessing.c +++ b/src/lib/core/multiprocessing.c @@ -98,7 +98,7 @@ struct MultiProcessingTask *mp_pool_task(struct MultiProcessingPool *pool, const } // Set default status to "error" - slot->status = -1; + slot->status = MP_POOL_TASK_STATUS_INITIAL; // Set task identifier string memset(slot->ident, 0, sizeof(slot->ident)); @@ -254,7 +254,7 @@ int mp_pool_join(struct MultiProcessingPool *pool, size_t jobs, size_t flags) { for (size_t i = lower_i; i < upper_i; i++) { struct MultiProcessingTask *slot = &pool->task[i]; - if (slot->status == -1) { + if (slot->status == MP_POOL_TASK_STATUS_INITIAL) { if (mp_task_fork(pool, slot)) { fprintf(stderr, "%s: mp_task_fork failed\n", slot->ident); kill(0, SIGTERM); |