PostgreSQL Source Code  git master
pthread-win32.c File Reference
#include "postgres_fe.h"
#include "pthread-win32.h"
Include dependency graph for pthread-win32.c:

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)
 

Function Documentation

◆ pthread_getspecific()

void* pthread_getspecific ( pthread_key_t  key)

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

30 {
31  return NULL;
32 }

Referenced by ecpg_finish(), ecpg_get_connection(), ecpg_get_connection_nr(), and ECPGget_sqlca().

◆ pthread_mutex_init()

int pthread_mutex_init ( pthread_mutex_t mp,
void *  attr 
)

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

36 {
37  *mp = (CRITICAL_SECTION *) malloc(sizeof(CRITICAL_SECTION));
38  if (!*mp)
39  return 1;
40  InitializeCriticalSection(*mp);
41  return 0;
42 }
#define malloc(a)
Definition: header.h:50

References malloc.

Referenced by default_threadlock(), pgtls_init(), and pthread_barrier_init().

◆ pthread_mutex_lock()

int pthread_mutex_lock ( pthread_mutex_t mp)

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

46 {
47  if (!*mp)
48  return 1;
49  EnterCriticalSection(*mp);
50  return 0;
51 }

Referenced by default_threadlock(), destroy_ssl_system(), ecpg_get_connection(), ecpg_log(), ECPGconnect(), ECPGdebug(), ECPGdisconnect(), pgtls_init(), and pthread_barrier_wait().

◆ pthread_mutex_unlock()

int pthread_mutex_unlock ( pthread_mutex_t mp)

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

55 {
56  if (!*mp)
57  return 1;
58  LeaveCriticalSection(*mp);
59  return 0;
60 }

Referenced by default_threadlock(), destroy_ssl_system(), ecpg_get_connection(), ecpg_log(), ECPGconnect(), ECPGdebug(), ECPGdisconnect(), pgtls_init(), and pthread_barrier_wait().

◆ pthread_self()

DWORD pthread_self ( void  )

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

19 {
20  return GetCurrentThreadId();
21 }

◆ pthread_setspecific()

void pthread_setspecific ( pthread_key_t  key,
void *  val 
)

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

25 {
26 }

Referenced by ecpg_finish(), ECPGconnect(), ECPGget_sqlca(), and ECPGsetconn().