Skip to content
Snippets Groups Projects
Commit 4b9fae60 authored by Jan Včelák's avatar Jan Včelák :rocket:
Browse files

tests: worker_pool_suspend, worker_pool_resume

refs #296
parent c17843a2
Branches
Tags
No related merge requests found
......@@ -112,6 +112,21 @@ int main(void)
worker_pool_wait(pool);
ok(executed_reset(&log) == TASKS_BATCH, "executed count after add");
// temporary suspension
worker_pool_suspend(pool);
for (int i = 0; i < TASKS_BATCH; i++) {
worker_pool_assign(pool, &task);
}
sched_yield();
ok(executed_reset(&log) == 0, "executed count after suspend");
worker_pool_resume(pool);
worker_pool_wait(pool);
ok(executed_reset(&log) == TASKS_BATCH, "executed count after resume");
// try clean
pthread_mutex_lock(&log.mx);
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment