[PATCH] virthreadpool: create threads from the newly expanded workers

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

 



when the thread pool is dynamically expanded, threads should
not be created from the existing workers; they should be created
from the newly expanded workers

Signed-off-by: Wei Gong <gongwei833x@xxxxxxxxx>
---
 src/util/virthreadpool.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/util/virthreadpool.c b/src/util/virthreadpool.c
index d45fa92061..6140b7a0a3 100644
--- a/src/util/virthreadpool.c
+++ b/src/util/virthreadpool.c
@@ -199,7 +199,7 @@ virThreadPoolExpand(virThreadPool *pool, size_t gain, bool priority)
         else
             name = g_strdup(pool->jobName);
 
-        if (virThreadCreateFull(&(*workers)[i],
+        if (virThreadCreateFull(&(*workers)[*curWorkers - gain + i],
                                 false,
                                 virThreadPoolWorker,
                                 name,
-- 
2.32.1 (Apple Git-133)
_______________________________________________
Devel mailing list -- devel@xxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxx




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux