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

From: Junio C Hamano <[email-masked]>
Date: Tue, 18 Nov 2025 10:17:27 -0800

"AZero13 via GitGitGadget" <[email-masked]> writes:

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

Is this mistitled?  The patch text talks about cond_init(), not cond_wait(),
which is the theme for the other patch around SleepConditionVariableCS().

> From: Greg Funni <[email-masked]>
>
> This value is not checked, but it must return to match POSIX
>
> Signed-off-by: Greg Funni <[email-masked]>
> ---
> ...
> 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