summaryrefslogtreecommitdiff
path: root/accel-pppd/triton
diff options
context:
space:
mode:
authorDmitry Kozlov <xeb@mail.ru>2017-12-27 11:43:09 +0300
committerDmitry Kozlov <xeb@mail.ru>2017-12-27 11:43:09 +0300
commit4c746c721ed4fadc15964b725707faf753843a9d (patch)
tree814727e4b8ed119b13178149a36d67ccf5183c83 /accel-pppd/triton
parent391079f127987c3e56c5d713c1b54b72417fd916 (diff)
downloadaccel-ppp-4c746c721ed4fadc15964b725707faf753843a9d.tar.gz
accel-ppp-4c746c721ed4fadc15964b725707faf753843a9d.zip
triton: fixed bugs introduced by previous commit
Diffstat (limited to 'accel-pppd/triton')
-rw-r--r--accel-pppd/triton/triton.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/accel-pppd/triton/triton.c b/accel-pppd/triton/triton.c
index 785d18f3..64ca7b8f 100644
--- a/accel-pppd/triton/triton.c
+++ b/accel-pppd/triton/triton.c
@@ -133,7 +133,7 @@ static void* triton_thread(struct _triton_thread_t *thread)
if (this_ctx->before_switch)
this_ctx->before_switch(this_ctx, thread->ctx->bf_arg);
- //alloca(thread->ctx->uc->uc_stack.ss_size);
+ alloca(thread->ctx->uc->uc_stack.ss_size + 64);
memcpy(thread_frame - thread->ctx->uc->uc_stack.ss_size, thread->ctx->uc->uc_stack.ss_sp, thread->ctx->uc->uc_stack.ss_size);
setcontext(thread->ctx->uc);
abort();
@@ -328,12 +328,12 @@ int triton_queue_ctx(struct _triton_context_t *ctx)
{
spin_lock(&threads_lock);
ctx->pending = 1;
- if (ctx->thread || ctx->queued || ctx->init || ctx->need_free) {
+ if (ctx->thread || ctx->entry2.next || ctx->need_free) {
spin_unlock(&threads_lock);
return 0;
}
- if (list_empty(&sleep_threads) || need_config_reload) {
+ if (list_empty(&sleep_threads) || ctx->init || need_config_reload) {
list_add_tail(&ctx->entry2, &ctx_queue[ctx->priority]);
spin_unlock(&threads_lock);
ctx->queued = 1;