windows: Include for Vista instead of defining CondVar/SRWLock functions ourself

This commit is contained in:
Martin Willi
2014-06-04 15:53:05 +02:00
parent 8120b3c339
commit 89e46c41f1
5 changed files with 12 additions and 33 deletions
+2 -3
View File
@@ -13,13 +13,12 @@
* for more details.
*/
#include <library.h>
#include "thread.h"
#include <utils/debug.h>
#include <threading/mutex.h>
#include <threading/condvar.h>
#include "thread.h"
typedef struct private_mutex_t private_mutex_t;
typedef struct private_condvar_t private_condvar_t;
+2 -3
View File
@@ -13,14 +13,13 @@
* for more details.
*/
#include <library.h>
#include "thread.h"
#include <utils/debug.h>
#include <threading/rwlock.h>
#include <threading/rwlock_condvar.h>
#include <threading/thread_value.h>
#include "thread.h"
typedef struct private_rwlock_t private_rwlock_t;
typedef struct private_rwlock_condvar_t private_rwlock_condvar_t;
+2 -3
View File
@@ -13,15 +13,14 @@
* for more details.
*/
#include <library.h>
#include "thread.h"
#include <utils/debug.h>
#include <threading/spinlock.h>
#include <threading/thread.h>
#include <collections/hashtable.h>
#include <collections/array.h>
#include "thread.h"
typedef struct private_thread_t private_thread_t;
+4 -21
View File
@@ -16,6 +16,10 @@
#ifndef WINDOWS_THREAD_H_
#define WINDOWS_THREAD_H_
/* for conditionVariables, Vista */
#define _WIN32_WINNT 0x0600
#include <library.h>
/**
* @defgroup windowsthread windows
* @ingroup threading
@@ -24,27 +28,6 @@
* @{ @ingroup windowsthread
*/
/**
* MinGW seems to miss the actual struct definition
*/
typedef struct {
PVOID Ptr;
} SRWLOCK, *PSRWLOCK, CONDITION_VARIABLE, *PCONDITION_VARIABLE;
VOID WINAPI InitializeConditionVariable(PCONDITION_VARIABLE ConditionVariable);
BOOL WINAPI SleepConditionVariableCS(PCONDITION_VARIABLE ConditionVariable,
PCRITICAL_SECTION CriticalSection, DWORD dwMilliseconds);
BOOL WINAPI SleepConditionVariableSRW(PCONDITION_VARIABLE ConditionVariable,
PSRWLOCK SRWLock, DWORD dwMilliseconds, ULONG Flags);
VOID WINAPI WakeAllConditionVariable(PCONDITION_VARIABLE ConditionVariable);
VOID WINAPI WakeConditionVariable(PCONDITION_VARIABLE ConditionVariable);
VOID WINAPI AcquireSRWLockExclusive(PSRWLOCK SRWLock);
VOID WINAPI AcquireSRWLockShared(PSRWLOCK SRWLock);
BOOL TryAcquireSRWLockExclusive(PSRWLOCK SRWLock);
VOID WINAPI InitializeSRWLock(PSRWLOCK SRWLock);
VOID WINAPI ReleaseSRWLockExclusive(PSRWLOCK SRWLock);
VOID WINAPI ReleaseSRWLockShared(PSRWLOCK SRWLock);
/**
* Set active condvar of a thread before waiting in it.
*
@@ -13,11 +13,10 @@
* for more details.
*/
#include <library.h>
#include <threading/thread_value.h>
#include "thread.h"
#include <threading/thread_value.h>
typedef struct private_thread_value_t private_thread_value_t;