PostgreSQL Source Code: src/port/pthread-win32.h File Reference (original) (raw)
Go to the source code of this file.
Typedefs | |
---|---|
typedef ULONG | pthread_key_t |
typedef struct pthread_mutex_t | pthread_mutex_t |
typedef int | pthread_once_t |
Functions | |
---|---|
DWORD | pthread_self (void) |
void | pthread_setspecific (pthread_key_t, void *) |
void * | pthread_getspecific (pthread_key_t) |
int | pthread_mutex_init (pthread_mutex_t *, void *attr) |
int | pthread_mutex_lock (pthread_mutex_t *) |
int | pthread_mutex_unlock (pthread_mutex_t *) |
◆ PTHREAD_MUTEX_INITIALIZER
#define PTHREAD_MUTEX_INITIALIZER { 0 }
◆ pthread_key_t
◆ pthread_mutex_t
◆ pthread_once_t
◆ 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}