summaryrefslogtreecommitdiff
path: root/accel-pppd/triton
diff options
context:
space:
mode:
authorKozlov Dmitry <xeb@mail.ru>2012-01-16 17:38:11 +0400
committerKozlov Dmitry <xeb@mail.ru>2012-01-16 17:38:11 +0400
commitc3633b1ab2bcd9d3855a88d435378aaa3c14ead9 (patch)
tree7a49965f23a1da0fa2290a4c5c16a62b734e4e60 /accel-pppd/triton
parentbf1ccc7f6e7a9dc5a8ba3d8d02b25ad446458840 (diff)
downloadaccel-ppp-c3633b1ab2bcd9d3855a88d435378aaa3c14ead9.tar.gz
accel-ppp-c3633b1ab2bcd9d3855a88d435378aaa3c14ead9.zip
core: fix context unregister bug
Diffstat (limited to 'accel-pppd/triton')
-rw-r--r--accel-pppd/triton/triton.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/accel-pppd/triton/triton.c b/accel-pppd/triton/triton.c
index 66c6cef5..d806231a 100644
--- a/accel-pppd/triton/triton.c
+++ b/accel-pppd/triton/triton.c
@@ -168,11 +168,11 @@ cont:
goto cont;
}
thread->ctx->thread = NULL;
+
spin_unlock(&thread->ctx->lock);
if (thread->ctx->need_free) {
log_debug2("- context %p removed\n", thread->ctx);
- thread->ctx->ud->tpd = NULL;
mempool_free(thread->ctx);
}
@@ -349,20 +349,25 @@ void __export triton_context_unregister(struct triton_context_t *ud)
}
abort();
}
+
if (!list_empty(&ctx->pending_handlers)) {
triton_log_error("BUG:ctx:triton_unregister_ctx: pending_handlers is not empty");
abort();
}
+
if (!list_empty(&ctx->timers)) {
triton_log_error("BUG:ctx:triton_unregister_ctx: timers is not empty");
abort();
}
+
if (!list_empty(&ctx->pending_timers)) {
triton_log_error("BUG:ctx:triton_unregister_ctx: pending_timers is not empty");
abort();
}
ctx->need_free = 1;
+ ud->tpd = NULL;
+
spin_lock(&ctx_list_lock);
list_del(&ctx->entry);
if (__sync_sub_and_fetch(&triton_stat.context_count, 1) == 1) {