mirror of
https://github.com/strongswan/strongswan.git
synced 2025-10-06 00:00:47 -04:00
processor: Move priority threads assignment to set_threads()
This avoids the evaluation of %N even if the thread pool is never used. We need to avoid as many custom printf specifiers as possible when fuzzing our code to avoid excessive log messages.
This commit is contained in:
parent
05eeffb2f2
commit
83eacc448c
@ -429,7 +429,15 @@ METHOD(processor_t, execute_job, void,
|
|||||||
METHOD(processor_t, set_threads, void,
|
METHOD(processor_t, set_threads, void,
|
||||||
private_processor_t *this, u_int count)
|
private_processor_t *this, u_int count)
|
||||||
{
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
this->mutex->lock(this->mutex);
|
this->mutex->lock(this->mutex);
|
||||||
|
for (i = 0; i < JOB_PRIO_MAX; i++)
|
||||||
|
{
|
||||||
|
this->prio_threads[i] = lib->settings->get_int(lib->settings,
|
||||||
|
"%s.processor.priority_threads.%N", 0, lib->ns,
|
||||||
|
job_priority_names, i);
|
||||||
|
}
|
||||||
if (count > this->total_threads)
|
if (count > this->total_threads)
|
||||||
{ /* increase thread count */
|
{ /* increase thread count */
|
||||||
worker_thread_t *worker;
|
worker_thread_t *worker;
|
||||||
@ -551,13 +559,10 @@ processor_t *processor_create()
|
|||||||
.job_added = condvar_create(CONDVAR_TYPE_DEFAULT),
|
.job_added = condvar_create(CONDVAR_TYPE_DEFAULT),
|
||||||
.thread_terminated = condvar_create(CONDVAR_TYPE_DEFAULT),
|
.thread_terminated = condvar_create(CONDVAR_TYPE_DEFAULT),
|
||||||
);
|
);
|
||||||
|
|
||||||
for (i = 0; i < JOB_PRIO_MAX; i++)
|
for (i = 0; i < JOB_PRIO_MAX; i++)
|
||||||
{
|
{
|
||||||
this->jobs[i] = linked_list_create();
|
this->jobs[i] = linked_list_create();
|
||||||
this->prio_threads[i] = lib->settings->get_int(lib->settings,
|
|
||||||
"%s.processor.priority_threads.%N", 0, lib->ns,
|
|
||||||
job_priority_names, i);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return &this->public;
|
return &this->public;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user