1 /*-------------------------------------------------------------------------
4 * partial pthread implementation for win32
6 * Copyright (c) 2004-2013, PostgreSQL Global Development Group
8 * src/interfaces/libpq/pthread-win32.c
10 *-------------------------------------------------------------------------
13 #include "postgres_fe.h"
16 #include "pthread-win32.h"
21 return GetCurrentThreadId();
25 pthread_setspecific(pthread_key_t key, void *val)
30 pthread_getspecific(pthread_key_t key)
36 pthread_mutex_init(pthread_mutex_t *mp, void *attr)
38 *mp = (CRITICAL_SECTION *) malloc(sizeof(CRITICAL_SECTION));
41 InitializeCriticalSection(*mp);
46 pthread_mutex_lock(pthread_mutex_t *mp)
50 EnterCriticalSection(*mp);
55 pthread_mutex_unlock(pthread_mutex_t *mp)
59 LeaveCriticalSection(*mp);