1/*-------------------------------------------------------------------------
4* partial pthread implementation for win32
6* Copyright (c) 2004-2025, PostgreSQL Global Development Group
8* src/interfaces/libpq/pthread-win32.c
10*-------------------------------------------------------------------------
20 return GetCurrentThreadId();
44 /* Initialize the csection if not already done */
49 while ((istate = InterlockedExchange(&mp->
initstate, 2)) == 2)
50 Sleep(0);
/* wait, another thread is doing this */
52 InitializeCriticalSection(&mp->
csection);
int pthread_mutex_unlock(pthread_mutex_t *mp)
int pthread_mutex_lock(pthread_mutex_t *mp)
void pthread_setspecific(pthread_key_t key, void *val)
void * pthread_getspecific(pthread_key_t key)
int pthread_mutex_init(pthread_mutex_t *mp, void *attr)
CRITICAL_SECTION csection