mirror of
https://github.com/git/git.git
synced 2026-01-17 14:21:57 +00:00
fixup! Implement pthread_cond_t with Win32 CONDITION_VARIABLE
In preparation for applying the patch that actually made it to the Git mailing list, let's revert this. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This commit is contained in:
@@ -57,8 +57,6 @@ pthread_t pthread_self(void)
|
||||
return t;
|
||||
}
|
||||
|
||||
#ifdef GIT_WIN_XP_SUPPORT
|
||||
|
||||
int pthread_cond_init(pthread_cond_t *cond, const void *unused)
|
||||
{
|
||||
cond->waiters = 0;
|
||||
@@ -196,41 +194,3 @@ int pthread_cond_broadcast(pthread_cond_t *cond)
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
#else // GIT_WIN_XP_SUPPORT
|
||||
|
||||
WINBASEAPI VOID WINAPI InitializeConditionVariable (PCONDITION_VARIABLE ConditionVariable);
|
||||
WINBASEAPI VOID WINAPI WakeConditionVariable (PCONDITION_VARIABLE ConditionVariable);
|
||||
WINBASEAPI VOID WINAPI WakeAllConditionVariable (PCONDITION_VARIABLE ConditionVariable);
|
||||
WINBASEAPI WINBOOL WINAPI SleepConditionVariableCS (PCONDITION_VARIABLE ConditionVariable, PCRITICAL_SECTION CriticalSection, DWORD dwMilliseconds);
|
||||
|
||||
int pthread_cond_init(pthread_cond_t *cond, const void *unused)
|
||||
{
|
||||
InitializeConditionVariable(cond);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int pthread_cond_destroy(pthread_cond_t *cond)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int pthread_cond_wait(pthread_cond_t *cond, CRITICAL_SECTION *mutex)
|
||||
{
|
||||
SleepConditionVariableCS(cond, mutex, INFINITE);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int pthread_cond_signal(pthread_cond_t *cond)
|
||||
{
|
||||
WakeConditionVariable(cond);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int pthread_cond_broadcast(pthread_cond_t *cond)
|
||||
{
|
||||
WakeAllConditionVariable(cond);
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif // GIT_WIN_XP_SUPPORT
|
||||
|
||||
@@ -32,7 +32,6 @@ typedef int pthread_mutexattr_t;
|
||||
#define pthread_mutexattr_settype(a, t) 0
|
||||
#define PTHREAD_MUTEX_RECURSIVE 0
|
||||
|
||||
#ifdef GIT_WIN_XP_SUPPORT
|
||||
/*
|
||||
* Implement simple condition variable for Windows threads, based on ACE
|
||||
* implementation.
|
||||
@@ -48,9 +47,6 @@ typedef struct {
|
||||
HANDLE sema;
|
||||
HANDLE continue_broadcast;
|
||||
} pthread_cond_t;
|
||||
#else
|
||||
typedef CONDITION_VARIABLE pthread_cond_t;
|
||||
#endif
|
||||
|
||||
extern int pthread_cond_init(pthread_cond_t *cond, const void *unused);
|
||||
extern int pthread_cond_destroy(pthread_cond_t *cond);
|
||||
|
||||
Reference in New Issue
Block a user