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

Go to the documentation of this file.

1

2

3

4

5

6

7

8

9

10

11

12

14

16

17DWORD

19{

20 return GetCurrentThreadId();

21}

22

23void

25{

26}

27

28void *

30{

31 return NULL;

32}

33

34int

36{

38 return 0;

39}

40

41int

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}

58

59int

61{

63 return EINVAL;

64 LeaveCriticalSection(&mp->csection);

65 return 0;

66}

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