[PATCH 5/8] kvm tools: initialize the threadpool job iterator before using

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This would fix a bug where the exit function of the threadpool would hang
if no jobs were processed yet and a request to exit was received.

Signed-off-by: Sasha Levin <levinsasha928@xxxxxxxxx>
---
 tools/kvm/util/threadpool.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/kvm/util/threadpool.c b/tools/kvm/util/threadpool.c
index 24e2344..85ac7e7 100644
--- a/tools/kvm/util/threadpool.c
+++ b/tools/kvm/util/threadpool.c
@@ -79,7 +79,7 @@ static void *thread_pool__threadfunc(void *param)
 	pthread_cleanup_push(thread_pool__threadfunc_cleanup, NULL);
 
 	while (running) {
-		struct thread_pool__job *curjob;
+		struct thread_pool__job *curjob = NULL;
 
 		mutex_lock(&job_mutex);
 		while (running && (curjob = thread_pool__job_pop_locked()) == NULL)
-- 
1.7.12

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux