mirror of
https://github.com/git/git.git
synced 2025-12-12 20:36:24 +01:00
Merge branch 'gf/win32-pthread-cond-wait-err'
Emulation code clean-up. * gf/win32-pthread-cond-wait-err: win32: return error if SleepConditionVariableCS fails
This commit is contained in:
@@ -59,3 +59,10 @@ pthread_t pthread_self(void)
|
|||||||
t.tid = GetCurrentThreadId();
|
t.tid = GetCurrentThreadId();
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex)
|
||||||
|
{
|
||||||
|
if (SleepConditionVariableCS(cond, mutex, INFINITE) == 0)
|
||||||
|
return err_win_to_posix(GetLastError());
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|||||||
@@ -36,7 +36,6 @@ typedef int pthread_mutexattr_t;
|
|||||||
|
|
||||||
#define pthread_cond_init(a,b) InitializeConditionVariable((a))
|
#define pthread_cond_init(a,b) InitializeConditionVariable((a))
|
||||||
#define pthread_cond_destroy(a) do {} while (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
|
#define pthread_cond_signal WakeConditionVariable
|
||||||
#define pthread_cond_broadcast WakeAllConditionVariable
|
#define pthread_cond_broadcast WakeAllConditionVariable
|
||||||
|
|
||||||
@@ -64,6 +63,8 @@ int win32_pthread_join(pthread_t *thread, void **value_ptr);
|
|||||||
#define pthread_equal(t1, t2) ((t1).tid == (t2).tid)
|
#define pthread_equal(t1, t2) ((t1).tid == (t2).tid)
|
||||||
pthread_t pthread_self(void);
|
pthread_t pthread_self(void);
|
||||||
|
|
||||||
|
int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex);
|
||||||
|
|
||||||
static inline void NORETURN pthread_exit(void *ret)
|
static inline void NORETURN pthread_exit(void *ret)
|
||||||
{
|
{
|
||||||
_endthreadex((unsigned)(uintptr_t)ret);
|
_endthreadex((unsigned)(uintptr_t)ret);
|
||||||
|
|||||||
Reference in New Issue
Block a user