mirror of
https://github.com/clearlinux/kvmtool.git
synced 2026-11-26 19:43:02 +00:00
kvm tools: Lock job_mutex before signalling
Locking mutex before signalling to prevent unexpected scheduling. Signed-off-by: Sasha Levin <levinsasha928@gmail.com> Signed-off-by: Pekka Enberg <penberg@kernel.org>
This commit is contained in:
@@ -166,5 +166,7 @@ void thread_pool__do_job(void *job)
|
||||
thread_pool__job_push_locked(job);
|
||||
mutex_unlock(&jobinfo->mutex);
|
||||
|
||||
mutex_lock(&job_mutex);
|
||||
pthread_cond_signal(&job_cond);
|
||||
mutex_unlock(&job_mutex);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user