diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2024-09-18 10:04:21 -0400 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2024-09-18 23:08:04 -0400 |
commit | 8b47235f7c81e04fa5efef492974509789f40273 (patch) | |
tree | 19dba6bed0ec155c18062dfa2a19789a87e4adcb | |
parent | 4efce32c6efcb98e3d4eda4886a75872aff6fff9 (diff) | |
download | stasis-8b47235f7c81e04fa5efef492974509789f40273.tar.gz |
Rename mp_task to mp_pool_task
-rw-r--r-- | include/multiprocessing.h | 2 | ||||
-rw-r--r-- | src/delivery.c | 4 | ||||
-rw-r--r-- | src/multiprocessing.c | 2 | ||||
-rw-r--r-- | tests/test_multiprocessing.c | 2 |
4 files changed, 5 insertions, 5 deletions
diff --git a/include/multiprocessing.h b/include/multiprocessing.h index 2356403..2db33df 100644 --- a/include/multiprocessing.h +++ b/include/multiprocessing.h @@ -94,7 +94,7 @@ struct MultiProcessingPool *mp_pool_init(const char *ident, const char *log_root * @return pointer to MultiProcessingTask structure * @return NULL on error */ -struct MultiProcessingTask *mp_task(struct MultiProcessingPool *pool, const char *ident, char *cmd); +struct MultiProcessingTask *mp_pool_task(struct MultiProcessingPool *pool, const char *ident, char *cmd); /** * Execute all tasks in a pool diff --git a/src/delivery.c b/src/delivery.c index c31a4dd..aba266b 100644 --- a/src/delivery.c +++ b/src/delivery.c @@ -1819,7 +1819,7 @@ void delivery_tests_run(struct Delivery *ctx) { } sprintf(runner_cmd, runner_cmd_fmt, cmd); - task = mp_task(pool, test->name, runner_cmd); + task = mp_pool_task(pool, test->name, runner_cmd); if (!task) { SYSERROR("Failed to add task to %s pool: %s", pool_name, runner_cmd); popd(); @@ -1872,7 +1872,7 @@ void delivery_tests_run(struct Delivery *ctx) { char runner_cmd[0xFFFF] = {0}; sprintf(runner_cmd, runner_cmd_fmt, cmd); - task = mp_task(pool, test->name, runner_cmd); + task = mp_pool_task(pool, test->name, runner_cmd); if (!task) { SYSERROR("Failed to add task %s to setup pool: %s", test->name, runner_cmd); popd(); diff --git a/src/multiprocessing.c b/src/multiprocessing.c index fce1a80..c784073 100644 --- a/src/multiprocessing.c +++ b/src/multiprocessing.c @@ -99,7 +99,7 @@ static int mp_task_fork(struct MultiProcessingPool *pool, struct MultiProcessing return parent(pool, task, pid, &child_status); } -struct MultiProcessingTask *mp_task(struct MultiProcessingPool *pool, const char *ident, char *cmd) { +struct MultiProcessingTask *mp_pool_task(struct MultiProcessingPool *pool, const char *ident, char *cmd) { struct MultiProcessingTask *slot = mp_pool_next_available(pool); if (pool->num_used != pool->num_alloc) { pool->num_used++; diff --git a/tests/test_multiprocessing.c b/tests/test_multiprocessing.c index 67574e3..1b2c865 100644 --- a/tests/test_multiprocessing.c +++ b/tests/test_multiprocessing.c @@ -35,7 +35,7 @@ void test_mp_task() { struct MultiProcessingTask *task; char task_name[100] = {0}; sprintf(task_name, "mytask%zu", i); - STASIS_ASSERT_FATAL((task = mp_task(pool, task_name, commands[i])) != NULL, "Task should not be NULL"); + STASIS_ASSERT_FATAL((task = mp_pool_task(pool, task_name, commands[i])) != NULL, "Task should not be NULL"); STASIS_ASSERT(task->pid != 0, "PID should be non-zero at this point"); STASIS_ASSERT(task->parent_pid != MP_POOL_PID_UNUSED, "Parent PID should be non-zero"); STASIS_ASSERT(task->status == -1, "Status should be -1 (not started yet)"); |