mirror of
https://git.openldap.org/openldap/openldap.git
synced 2024-12-27 03:20:22 +08:00
Windows fixes
This commit is contained in:
parent
7d996d7f3d
commit
61f7ec9bfa
@ -192,16 +192,16 @@
|
|||||||
#define pthread_key_delete(x) TlsFree(x)
|
#define pthread_key_delete(x) TlsFree(x)
|
||||||
#define pthread_getspecific(x) TlsGetValue(x)
|
#define pthread_getspecific(x) TlsGetValue(x)
|
||||||
#define pthread_setspecific(x,y) (TlsSetValue(x,y) ? 0 : ErrCode())
|
#define pthread_setspecific(x,y) (TlsSetValue(x,y) ? 0 : ErrCode())
|
||||||
#define pthread_mutex_unlock(x) ReleaseMutex(x)
|
#define pthread_mutex_unlock(x) ReleaseMutex(*x)
|
||||||
#define pthread_mutex_lock(x) WaitForSingleObject(x, INFINITE)
|
#define pthread_mutex_lock(x) WaitForSingleObject(*x, INFINITE)
|
||||||
#define pthread_cond_signal(x) SetEvent(*x)
|
#define pthread_cond_signal(x) SetEvent(*x)
|
||||||
#define pthread_cond_wait(cond,mutex) SignalObjectAndWait(*mutex, *cond, INFINITE, FALSE); WaitForSingleObject(*mutex, INFINITE)
|
#define pthread_cond_wait(cond,mutex) do{SignalObjectAndWait(*mutex, *cond, INFINITE, FALSE); WaitForSingleObject(*mutex, INFINITE);}while(0)
|
||||||
#define THREAD_CREATE(thr,start,arg) thr=CreateThread(NULL,0,start,arg,0,NULL)
|
#define THREAD_CREATE(thr,start,arg) thr=CreateThread(NULL,0,start,arg,0,NULL)
|
||||||
#define THREAD_FINISH(thr) WaitForSingleObject(thr, INFINITE)
|
#define THREAD_FINISH(thr) WaitForSingleObject(thr, INFINITE)
|
||||||
#define LOCK_MUTEX_R(env) pthread_mutex_lock((env)->me_rmutex)
|
#define LOCK_MUTEX_R(env) pthread_mutex_lock(&(env)->me_rmutex)
|
||||||
#define UNLOCK_MUTEX_R(env) pthread_mutex_unlock((env)->me_rmutex)
|
#define UNLOCK_MUTEX_R(env) pthread_mutex_unlock(&(env)->me_rmutex)
|
||||||
#define LOCK_MUTEX_W(env) pthread_mutex_lock((env)->me_wmutex)
|
#define LOCK_MUTEX_W(env) pthread_mutex_lock(&(env)->me_wmutex)
|
||||||
#define UNLOCK_MUTEX_W(env) pthread_mutex_unlock((env)->me_wmutex)
|
#define UNLOCK_MUTEX_W(env) pthread_mutex_unlock(&(env)->me_wmutex)
|
||||||
#define getpid() GetCurrentProcessId()
|
#define getpid() GetCurrentProcessId()
|
||||||
#define MDB_FDATASYNC(fd) (!FlushFileBuffers(fd))
|
#define MDB_FDATASYNC(fd) (!FlushFileBuffers(fd))
|
||||||
#define MDB_MSYNC(addr,len,flags) (!FlushViewOfFile(addr,len))
|
#define MDB_MSYNC(addr,len,flags) (!FlushViewOfFile(addr,len))
|
||||||
|
Loading…
Reference in New Issue
Block a user