Header And Logo

PostgreSQL
| The world's most advanced open source database.

Functions

pthread-win32.c File Reference

#include "postgres_fe.h"
#include <windows.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

void* pthread_getspecific ( pthread_key_t  key  ) 

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

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

{
    return NULL;
}

int pthread_mutex_init ( pthread_mutex_t mp,
void *  attr 
)

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

References malloc.

Referenced by default_threadlock().

{
    *mp = (CRITICAL_SECTION *) malloc(sizeof(CRITICAL_SECTION));
    if (!*mp)
        return 1;
    InitializeCriticalSection(*mp);
    return 0;
}

int pthread_mutex_lock ( pthread_mutex_t mp  ) 

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

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

{
    if (!*mp)
        return 1;
    EnterCriticalSection(*mp);
    return 0;
}

int pthread_mutex_unlock ( pthread_mutex_t mp  ) 

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

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

{
    if (!*mp)
        return 1;
    LeaveCriticalSection(*mp);
    return 0;
}

DWORD pthread_self ( void   ) 

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

{
    return GetCurrentThreadId();
}

void pthread_setspecific ( pthread_key_t  key,
void *  val 
)

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

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

{
}