Pyrogenesis  trunk
Classes | Functions | Variables
wpthread.cpp File Reference
#include "precompiled.h"
#include "lib/sysdep/os/win/wposix/wpthread.h"
#include <new>
#include <process.h>
#include "lib/sysdep/cpu.h"
#include "lib/posix/posix_filesystem.h"
#include "lib/sysdep/os/win/wposix/wposix_internal.h"
#include "lib/sysdep/os/win/wposix/wtime.h"
#include "lib/sysdep/os/win/wseh.h"
#include "lib/sysdep/os/win/winit.h"
Include dependency graph for wpthread.cpp:

Classes

struct  FuncAndArg
 

Functions

 WINIT_REGISTER_CRITICAL_INIT (wpthread_Init)
 
static HANDLE HANDLE_from_pthread (pthread_t p)
 
static pthread_t pthread_from_HANDLE (HANDLE h)
 
static __declspec (thread) HANDLE hCurrentThread
 
static void NotifyCurrentThread ()
 
int pthread_equal (pthread_t t1, pthread_t t2)
 
pthread_t pthread_self ()
 
int pthread_once (pthread_once_t *once, void(*init_routine)())
 
int pthread_getschedparam (pthread_t thread, int *policy, struct sched_param *param)
 
int pthread_setschedparam (pthread_t thread, int policy, const struct sched_param *param)
 
int pthread_key_create (pthread_key_t *key, void(*dtor)(void *))
 
int pthread_key_delete (pthread_key_t key)
 
void * pthread_getspecific (pthread_key_t key)
 
int pthread_setspecific (pthread_key_t key, const void *value)
 
static void call_tls_dtors ()
 
int pthread_mutexattr_init (pthread_mutexattr_t *attr)
 
int pthread_mutexattr_destroy (pthread_mutexattr_t *attr)
 
int pthread_mutexattr_gettype (const pthread_mutexattr_t *attr, int *type)
 
int pthread_mutexattr_settype (pthread_mutexattr_t *attr, int type)
 
static CRITICAL_SECTION * CRITICAL_SECTION_from_pthread_mutex_t (pthread_mutex_t *m)
 
pthread_mutex_t pthread_mutex_initializer ()
 
int pthread_mutex_destroy (pthread_mutex_t *m)
 
int pthread_mutex_init (pthread_mutex_t *m, const pthread_mutexattr_t *)
 
int pthread_mutex_lock (pthread_mutex_t *m)
 
int pthread_mutex_trylock (pthread_mutex_t *m)
 
int pthread_mutex_unlock (pthread_mutex_t *m)
 
int pthread_mutex_timedlock (pthread_mutex_t *m, const struct timespec *abs_timeout)
 
static HANDLE HANDLE_from_sem_t (sem_t *sem)
 
sem_tsem_open (const char *name, int oflag,...)
 
int sem_close (sem_t *sem)
 
int sem_unlink (const char *name)
 
int sem_init (sem_t *sem, int pshared, unsigned value)
 
int sem_destroy (sem_t *sem)
 
int sem_post (sem_t *sem)
 
int sem_wait (sem_t *sem)
 
static DWORD calc_timeout_length_ms (const struct timespec *abs_timeout, bool &timeout_is_valid)
 
int sem_timedwait (sem_t *sem, const struct timespec *abs_timeout)
 
int sem_msgwait_np (sem_t *sem)
 
static unsigned __stdcall thread_start (void *param)
 
int pthread_create (pthread_t *thread_id, const void *attr, void *(*func)(void *), void *arg)
 
int pthread_cancel (pthread_t thread)
 
int pthread_join (pthread_t thread, void **value_ptr)
 
static Status wpthread_Init ()
 

Variables

static const size_t TLS_LIMIT = 64
 
static const size_t MAX_DTORS = 4
 
struct {
   pthread_key_t   key
 
   void(*   dtor )(void *)
 
dtors [MAX_DTORS]
 

Function Documentation

static __declspec ( thread  )
static
static DWORD calc_timeout_length_ms ( const struct timespec abs_timeout,
bool &  timeout_is_valid 
)
static
static void call_tls_dtors ( )
static
static CRITICAL_SECTION* CRITICAL_SECTION_from_pthread_mutex_t ( pthread_mutex_t m)
static
static HANDLE HANDLE_from_pthread ( pthread_t  p)
static
static HANDLE HANDLE_from_sem_t ( sem_t sem)
static
static void NotifyCurrentThread ( )
static
int pthread_cancel ( pthread_t  thread)
int pthread_create ( pthread_t thread_id,
const void *  attr,
void *(*)(void *)  func,
void *  arg 
)
int pthread_equal ( pthread_t  t1,
pthread_t  t2 
)
static pthread_t pthread_from_HANDLE ( HANDLE  h)
static
int pthread_getschedparam ( pthread_t  thread,
int *  policy,
struct sched_param param 
)
void* pthread_getspecific ( pthread_key_t  key)
int pthread_join ( pthread_t  thread,
void **  value_ptr 
)
int pthread_key_create ( pthread_key_t key,
void(*)(void *)  dtor 
)
int pthread_key_delete ( pthread_key_t  key)
int pthread_mutex_destroy ( pthread_mutex_t m)
int pthread_mutex_init ( pthread_mutex_t m,
const pthread_mutexattr_t  
)
pthread_mutex_t pthread_mutex_initializer ( )
int pthread_mutex_lock ( pthread_mutex_t m)
int pthread_mutex_timedlock ( pthread_mutex_t m,
const struct timespec abs_timeout 
)
int pthread_mutex_trylock ( pthread_mutex_t m)
int pthread_mutex_unlock ( pthread_mutex_t m)
int pthread_mutexattr_destroy ( pthread_mutexattr_t attr)
int pthread_mutexattr_gettype ( const pthread_mutexattr_t attr,
int *  type 
)
int pthread_mutexattr_init ( pthread_mutexattr_t attr)
int pthread_mutexattr_settype ( pthread_mutexattr_t attr,
int  type 
)
int pthread_once ( pthread_once_t once,
void(*)()  init_routine 
)
pthread_t pthread_self ( )
int pthread_setschedparam ( pthread_t  thread,
int  policy,
const struct sched_param param 
)
int pthread_setspecific ( pthread_key_t  key,
const void *  value 
)
int sem_close ( sem_t sem)
int sem_destroy ( sem_t sem)
int sem_init ( sem_t sem,
int  pshared,
unsigned  value 
)
int sem_msgwait_np ( sem_t sem)
sem_t* sem_open ( const char *  name,
int  oflag,
  ... 
)
int sem_post ( sem_t sem)
int sem_timedwait ( sem_t sem,
const struct timespec abs_timeout 
)
int sem_unlink ( const char *  name)
int sem_wait ( sem_t sem)
static unsigned __stdcall thread_start ( void *  param)
static
WINIT_REGISTER_CRITICAL_INIT ( wpthread_Init  )
static Status wpthread_Init ( )
static

Variable Documentation

void(* dtor) (void *)
struct { ... } dtors[MAX_DTORS]
const size_t MAX_DTORS = 4
static
const size_t TLS_LIMIT = 64
static