Subject: [PATCH v2] win32: pthread_cond_wait should return a value

From: "AZero13 via GitGitGadget" <[email-masked]>
Date: Tue, 18 Nov 2025 15:42:26 +0000

From: Greg Funni <[email-masked]>

This value is not checked, but it must return to match POSIX

Signed-off-by: Greg Funni <[email-masked]>
---
    win32: pthread_cond_wait should return a value
    
    This value is not checked, but it must return to match POSIX

Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-2103%2FAZero13%2Fpthread-v2
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-2103/AZero13/pthread-v2
Pull-Request: https://github.com/git/git/pull/2103

Range-diff vs v1:

 1:  643a9b7eae ! 1:  a2d9ec97f1 win32: pthread_cond_wait should return a value
     @@
       ## Metadata ##
     -Author: AZero13 <[email-masked]>
     +Author: Greg Funni <[email-masked]>
      
       ## Commit message ##
          win32: pthread_cond_wait should return a value

 compat/win32/pthread.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/compat/win32/pthread.h b/compat/win32/pthread.h
index e2b5c4f64c..000604cdf6 100644
--- a/compat/win32/pthread.h
+++ b/compat/win32/pthread.h
@@ -34,7 +34,7 @@ typedef int pthread_mutexattr_t;
 
 #define pthread_cond_t CONDITION_VARIABLE
 
-#define pthread_cond_init(a,b) InitializeConditionVariable((a))
+#define pthread_cond_init(a,b) return_0((InitializeConditionVariable((a)), 0))
 #define pthread_cond_destroy(a) do {} while (0)
 #define pthread_cond_wait(a,b) return_0(SleepConditionVariableCS((a), (b), INFINITE))
 #define pthread_cond_signal WakeConditionVariable

base-commit: 9a2fb147f2c61d0cab52c883e7e26f5b7948e3ed
-- 
gitgitgadget