kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] kvm tools: Lock job_mutex before signalling
@ 2011-04-30 13:30 Sasha Levin
  2011-04-30 13:30 ` [PATCH 2/3] kvm tools: Introduce virtio-rng Sasha Levin
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Sasha Levin @ 2011-04-30 13:30 UTC (permalink / raw)
  To: penberg; +Cc: mingo, asias.hejun, gorcunov, prasadjoshi124, kvm, Sasha Levin

Locking mutex before signalling to prevent unexpected
scheduling.

Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
---
 tools/kvm/threadpool.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/tools/kvm/threadpool.c b/tools/kvm/threadpool.c
index c584ec7..700c08f 100644
--- a/tools/kvm/threadpool.c
+++ b/tools/kvm/threadpool.c
@@ -166,5 +166,7 @@ void thread_pool__signal_work(void *job)
 		thread_pool__job_info_push_locked(job);
 	mutex_unlock(&jobinfo->mutex);
 
+	mutex_lock(&job_mutex);
 	pthread_cond_signal(&job_cond);
+	mutex_unlock(&job_mutex);
 }
-- 
1.7.5.rc3


^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2011-05-05 22:00 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-30 13:30 [PATCH 1/3] kvm tools: Lock job_mutex before signalling Sasha Levin
2011-04-30 13:30 ` [PATCH 2/3] kvm tools: Introduce virtio-rng Sasha Levin
2011-05-05  6:54   ` Ingo Molnar
2011-05-05  7:09     ` Pekka Enberg
2011-05-05  7:12       ` Ingo Molnar
2011-05-05  7:14         ` Pekka Enberg
2011-05-05  7:20           ` Sasha Levin
2011-05-05 16:04           ` Sasha Levin
2011-05-05 22:00             ` Ingo Molnar
2011-05-05  7:14         ` Ingo Molnar
2011-04-30 13:30 ` [PATCH 3/3] kvm tools: Add cmdline switch to enable virtio-rng Sasha Levin
2011-05-01  7:10 ` [PATCH 1/3] kvm tools: Lock job_mutex before signalling Pekka Enberg
2011-05-01  7:43   ` Sasha Levin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).