diff options
author | Dmitry Kozlov <xeb@mail.ru> | 2018-05-28 17:18:04 +0300 |
---|---|---|
committer | Dmitry Kozlov <xeb@mail.ru> | 2018-05-29 17:26:32 +0300 |
commit | cead7e72688f475c9bd2f8c7b9d650d07b300056 (patch) | |
tree | 52612e2bba5b9bd317b3177b93a70cd84011571e | |
parent | f5313ce5dc5192f4539eceacd621bfe193a0eb97 (diff) | |
download | accel-ppp-cead7e72688f475c9bd2f8c7b9d650d07b300056.tar.gz accel-ppp-cead7e72688f475c9bd2f8c7b9d650d07b300056.zip |
triton: fixed improper locking
-rw-r--r-- | accel-pppd/triton/triton.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/accel-pppd/triton/triton.c b/accel-pppd/triton/triton.c index 7a494a5a..f1b4069f 100644 --- a/accel-pppd/triton/triton.c +++ b/accel-pppd/triton/triton.c @@ -101,11 +101,9 @@ static void* triton_thread(struct _triton_thread_t *thread) thread->ctx = list_entry(ctx_queue.next, typeof(*thread->ctx), entry2); log_debug2("thread: %p: dequeued ctx %p\n", thread, thread->ctx); list_del(&thread->ctx->entry2); - spin_unlock(&threads_lock); - spin_lock(&thread->ctx->lock); thread->ctx->thread = thread; thread->ctx->queued = 0; - spin_unlock(&thread->ctx->lock); + spin_unlock(&threads_lock); __sync_sub_and_fetch(&triton_stat.context_pending, 1); } else { if (triton_stat.thread_count > thread_count + triton_stat.context_sleeping) { |