this->mutex->unlock(this->mutex);
}
+METHOD(processor_t, get_threads, u_int,
+ private_processor_t *this)
+{
+ return this->desired_threads;
+}
+
METHOD(processor_t, cancel, void,
private_processor_t *this)
{
.get_job_load = _get_job_load,
.queue_job = _queue_job,
.set_threads = _set_threads,
+ .get_threads = _get_threads,
.cancel = _cancel,
.destroy = _destroy,
},
return &this->public;
}
-
*/
void (*set_threads)(processor_t *this, u_int count);
+ /**
+ * Get the number of threads set with set_threads().
+ *
+ * This does not actually reflect the number of threads currently active,
+ * but the number of threads targeted.
+ *
+ * @return number of desired threads
+ */
+ u_int (*get_threads)(processor_t *this);
+
/**
* Sets the number of threads to 0 and cancels all blocking jobs, then waits
* for all threads to be terminated.