kernel: Add chainstate manager option for setting worker threads

Re-use the same pattern used for the context options. This allows users
to set the number of threads used in the validation thread pool.
This commit is contained in:
TheCharlatan
2024-11-17 17:36:48 +01:00
parent 65571c36a2
commit e2c1bd3d71
4 changed files with 24 additions and 0 deletions

View File

@@ -689,6 +689,12 @@ btck_ChainstateManagerOptions* btck_chainstate_manager_options_create(const btck
}
}
void btck_chainstate_manager_options_set_worker_threads_num(btck_ChainstateManagerOptions* opts, int worker_threads)
{
LOCK(btck_ChainstateManagerOptions::get(opts).m_mutex);
btck_ChainstateManagerOptions::get(opts).m_chainman_options.worker_threads_num = worker_threads;
}
void btck_chainstate_manager_options_destroy(btck_ChainstateManagerOptions* options)
{
delete options;