aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces/ecpg/include/ecpg-pthread-win32.h
blob: df076ac8e595e2ac877f0e292371eaa457a2a79f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/* $PostgreSQL: pgsql/src/interfaces/ecpg/include/ecpg-pthread-win32.h,v 1.1 2007/03/29 12:02:24 meskes Exp $ */
/*
 * pthread mapping macros for win32 native thread implementation
 */
#ifndef _ECPG_PTHREAD_WIN32_H
#define _ECPG_PTHREAD_WIN32_H
#define pthread_mutex_lock(x) do { \
	if (*x == INVALID_HANDLE_VALUE) \
	   *x = CreateMutex(NULL, FALSE, NULL); \
    WaitForSingleObject(*x, INFINITE); \
} while (0);
#define pthread_mutex_unlock(x) ReleaseMutex(*x)
#define pthread_getspecific(x) TlsGetValue(x)
#define pthread_setspecific(x,y) TlsSetValue(x,y)
#define pthread_key_create(x,y) *x = TlsAlloc();
#endif