summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKozlov Dmitry <dima@server>2010-12-29 19:09:45 +0300
committerKozlov Dmitry <dima@server>2010-12-29 19:09:45 +0300
commita1124d71dafdea11c4869e2a45ff9c3e105e3592 (patch)
treea3be7e8cdbf30941a3347a367495be384be77735
parent1be76a6d12ea1c0052ad3b57c31151543f67e7cd (diff)
downloadaccel-ppp-a1124d71dafdea11c4869e2a45ff9c3e105e3592.tar.gz
accel-ppp-a1124d71dafdea11c4869e2a45ff9c3e105e3592.zip
fix statistics calculation
-rw-r--r--accel-pptpd/triton/md.c4
-rw-r--r--accel-pptpd/triton/timer.c4
2 files changed, 6 insertions, 2 deletions
diff --git a/accel-pptpd/triton/md.c b/accel-pptpd/triton/md.c
index d8453896..84073d05 100644
--- a/accel-pptpd/triton/md.c
+++ b/accel-pptpd/triton/md.c
@@ -140,8 +140,10 @@ void __export triton_md_unregister_handler(struct triton_md_handler_t *ud)
spin_lock(&h->ctx->lock);
h->ud = NULL;
list_del(&h->entry);
- if (h->pending)
+ if (h->pending) {
list_del(&h->entry2);
+ __sync_sub_and_fetch(&triton_stat.md_handler_pending, 1);
+ }
spin_unlock(&h->ctx->lock);
sched_yield();
diff --git a/accel-pptpd/triton/timer.c b/accel-pptpd/triton/timer.c
index 4e37754c..7d117308 100644
--- a/accel-pptpd/triton/timer.c
+++ b/accel-pptpd/triton/timer.c
@@ -202,8 +202,10 @@ void __export triton_timer_del(struct triton_timer_t *ud)
spin_lock(&t->ctx->lock);
t->ud = NULL;
list_del(&t->entry);
- if (t->pending)
+ if (t->pending) {
list_del(&t->entry2);
+ __sync_sub_and_fetch(&triton_stat.timer_pending, 1);
+ }
spin_unlock(&t->ctx->lock);
sched_yield();