PostgreSQL Source Code: src/interfaces/libpq/pthread-win32.c File Reference (original) (raw)

Go to the source code of this file.

Functions
DWORD pthread_self (void)
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)
int pthread_mutex_lock (pthread_mutex_t *mp)
int pthread_mutex_unlock (pthread_mutex_t *mp)

pthread_getspecific()

pthread_mutex_init()

pthread_mutex_lock()

Definition at line 42 of file pthread-win32.c.

43{

44

46 {

47 LONG istate;

48

49 while ((istate = InterlockedExchange(&mp->initstate, 2)) == 2)

50 Sleep(0);

51 if (istate != 1)

52 InitializeCriticalSection(&mp->csection);

53 InterlockedExchange(&mp->initstate, 1);

54 }

55 EnterCriticalSection(&mp->csection);

56 return 0;

57}

CRITICAL_SECTION csection

References pthread_mutex_t::csection, and pthread_mutex_t::initstate.

Referenced by default_threadlock(), ecpg_get_connection(), ecpg_log(), ECPGconnect(), ECPGdebug(), ECPGdisconnect(), pg_localeconv_r(), pgconn_bio_method(), and pthread_barrier_wait().

pthread_mutex_unlock()

pthread_self()

DWORD pthread_self ( void )

Definition at line 18 of file pthread-win32.c.

19{

20 return GetCurrentThreadId();

21}

pthread_setspecific()