diff options
author | Tobias Brunner <tobias@strongswan.org> | 2011-07-18 18:45:13 +0200 |
---|---|---|
committer | Tobias Brunner <tobias@strongswan.org> | 2011-07-18 18:46:50 +0200 |
commit | d604e791855cd62c3d946768fe02500f53b3b7e1 (patch) | |
tree | 2be3860e51fe9b02e344cec033a863256664ac50 /src/libcharon/plugins/load_tester/load_tester_plugin.c | |
parent | ebbdc3250b267f7089fe4a20f04af7da55fd92e0 (diff) | |
download | strongswan-d604e791855cd62c3d946768fe02500f53b3b7e1.tar.bz2 strongswan-d604e791855cd62c3d946768fe02500f53b3b7e1.tar.xz |
Count running load-tester threads properly.
Diffstat (limited to 'src/libcharon/plugins/load_tester/load_tester_plugin.c')
-rw-r--r-- | src/libcharon/plugins/load_tester/load_tester_plugin.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/libcharon/plugins/load_tester/load_tester_plugin.c b/src/libcharon/plugins/load_tester/load_tester_plugin.c index a59fa231e..243e6e1ab 100644 --- a/src/libcharon/plugins/load_tester/load_tester_plugin.c +++ b/src/libcharon/plugins/load_tester/load_tester_plugin.c @@ -101,10 +101,7 @@ static job_requeue_t do_load_test(private_load_tester_plugin_t *this) int i, s = 0, ms = 0; this->mutex->lock(this->mutex); - if (!this->running) - { - this->running = this->initiators; - } + this->running++; this->mutex->unlock(this->mutex); if (this->delay) { @@ -163,8 +160,8 @@ static job_requeue_t do_load_test(private_load_tester_plugin_t *this) } this->mutex->lock(this->mutex); this->running--; - this->mutex->unlock(this->mutex); this->condvar->signal(this->condvar); + this->mutex->unlock(this->mutex); return JOB_REQUEUE_NONE; } @@ -255,7 +252,6 @@ plugin_t *load_tester_plugin_create() hydra->kernel_interface->add_ipsec_interface(hydra->kernel_interface, (kernel_ipsec_constructor_t)load_tester_ipsec_create); } - this->running = 0; for (i = 0; i < this->initiators; i++) { lib->processor->queue_job(lib->processor, (job_t*) |