[PATCH] virThreadPool: Don't create joinable threads

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

 



Otherwise these threads won't clean after themselves,
as we are not joining them:

==26697== 1,680 bytes in 5 blocks are possibly lost in loss record 913 of 942
==26697==    at 0x4C2BDE4: calloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==26697==    by 0x4011131: allocate_dtv (in /lib64/ld-2.16.so)
==26697==    by 0x401176D: _dl_allocate_tls (in /lib64/ld-2.16.so)
==26697==    by 0x8499602: pthread_create@@GLIBC_2.2.5 (in /lib64/libpthread-2.16.so)
==26697==    by 0x52F53E9: virThreadCreate (virthreadpthread.c:188)
==26697==    by 0x52F5D4F: virThreadPoolNew (virthreadpool.c:221)
==26697==    by 0x53F30DB: virNetServerNew (virnetserver.c:377)
==26697==    by 0x11C6ED: main (libvirtd.c:1366)

Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
---
 src/util/virthreadpool.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/util/virthreadpool.c b/src/util/virthreadpool.c
index b1e2c0c..cb9e390 100644
--- a/src/util/virthreadpool.c
+++ b/src/util/virthreadpool.c
@@ -197,7 +197,7 @@ virThreadPoolPtr virThreadPoolNew(size_t minWorkers,
         data->cond = &pool->cond;
 
         if (virThreadCreate(&pool->workers[i],
-                            true,
+                            false,
                             virThreadPoolWorker,
                             data) < 0) {
             goto error;
@@ -219,7 +219,7 @@ virThreadPoolPtr virThreadPoolNew(size_t minWorkers,
             data->priority = true;
 
             if (virThreadCreate(&pool->prioWorkers[i],
-                                true,
+                                false,
                                 virThreadPoolWorker,
                                 data) < 0) {
                 goto error;
@@ -319,7 +319,7 @@ int virThreadPoolSendJob(virThreadPoolPtr pool,
         data->cond = &pool->cond;
 
         if (virThreadCreate(&pool->workers[pool->nWorkers - 1],
-                            true,
+                            false,
                             virThreadPoolWorker,
                             data) < 0) {
             VIR_FREE(data);
-- 
1.8.4.4

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[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]