From 58748c0a3896b80521ccd23fd5855acd89f05825 Mon Sep 17 00:00:00 2001
From: Volker Lendecke <vl@samba.org>
Date: Tue, 5 Dec 2017 15:34:09 +0100
Subject: [PATCH] lib: Don't use PTHREAD_COND_INITIALIZER for a stack variable

susv4 speaks about statically allocated variables. Stack vars are not.
---
 source3/lib/pthreadpool/pthreadpool.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/source3/lib/pthreadpool/pthreadpool.c b/source3/lib/pthreadpool/pthreadpool.c
index 23885aa6d11..646708adb62 100644
--- a/source3/lib/pthreadpool/pthreadpool.c
+++ b/source3/lib/pthreadpool/pthreadpool.c
@@ -179,9 +179,12 @@ int pthreadpool_init(unsigned max_threads, struct pthreadpool **presult,
 
 static void pthreadpool_prepare_pool(struct pthreadpool *pool)
 {
-	pthread_cond_t prefork_cond = PTHREAD_COND_INITIALIZER;
+	pthread_cond_t prefork_cond;
 	int ret;
 
+	ret = pthread_cond_init(&prefork_cond, NULL);
+	assert(ret == 0);
+
 	ret = pthread_mutex_lock(&pool->mutex);
 	assert(ret == 0);
 
-- 
2.11.0

