p_thread.h File Reference

Include dependency graph for p_thread.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  pipe_tsd

Defines

#define pipe_static_mutex(mutex)   static pipe_mutex mutex = 0
#define pipe_mutex_init(mutex)   (void) mutex
#define pipe_mutex_destroy(mutex)   (void) mutex
#define pipe_mutex_lock(mutex)   (void) mutex
#define pipe_mutex_unlock(mutex)   (void) mutex
#define pipe_static_condvar(condvar)   static unsigned condvar = 0
#define pipe_condvar_init(condvar)   (void) condvar
#define pipe_condvar_destroy(condvar)   (void) condvar
#define pipe_condvar_wait(condvar, mutex)   (void) condvar
#define pipe_condvar_signal(condvar)   (void) condvar
#define pipe_condvar_broadcast(condvar)   (void) condvar
#define PIPE_TSD_INIT_MAGIC   0xff8adc98

Typedefs

typedef unsigned pipe_thread
 Thread, mutex, condition var and thread-specific data functions.
typedef unsigned pipe_mutex
typedef unsigned pipe_condvar

Functions

static void pipe_tsd_init (pipe_tsd *tsd)
static void * pipe_tsd_get (pipe_tsd *tsd)
static void pipe_tsd_set (pipe_tsd *tsd, void *value)


Define Documentation

#define pipe_condvar_broadcast ( condvar   )     (void) condvar

Definition at line 198 of file p_thread.h.

#define pipe_condvar_destroy ( condvar   )     (void) condvar

Definition at line 189 of file p_thread.h.

#define pipe_condvar_init ( condvar   )     (void) condvar

Definition at line 186 of file p_thread.h.

#define pipe_condvar_signal ( condvar   )     (void) condvar

Definition at line 195 of file p_thread.h.

#define pipe_condvar_wait ( condvar,
mutex   )     (void) condvar

Definition at line 192 of file p_thread.h.

#define pipe_mutex_destroy ( mutex   )     (void) mutex

Definition at line 174 of file p_thread.h.

#define pipe_mutex_init ( mutex   )     (void) mutex

Definition at line 171 of file p_thread.h.

#define pipe_mutex_lock ( mutex   )     (void) mutex

Definition at line 177 of file p_thread.h.

#define pipe_mutex_unlock ( mutex   )     (void) mutex

Definition at line 180 of file p_thread.h.

#define pipe_static_condvar ( condvar   )     static unsigned condvar = 0

Definition at line 183 of file p_thread.h.

#define pipe_static_mutex ( mutex   )     static pipe_mutex mutex = 0

Definition at line 168 of file p_thread.h.

#define PIPE_TSD_INIT_MAGIC   0xff8adc98

Definition at line 220 of file p_thread.h.


Typedef Documentation

typedef unsigned pipe_condvar

Definition at line 166 of file p_thread.h.

typedef unsigned pipe_mutex

Definition at line 165 of file p_thread.h.

typedef unsigned pipe_thread

Thread, mutex, condition var and thread-specific data functions.

Dummy definitions

Definition at line 164 of file p_thread.h.


Function Documentation

static void* pipe_tsd_get ( pipe_tsd tsd  )  [static]

Definition at line 238 of file p_thread.h.

References assert, pipe_tsd::initMagic, pipe_tsd_init(), and PIPE_TSD_INIT_MAGIC.

00240 {
00241    if (tsd->initMagic != (int) PIPE_TSD_INIT_MAGIC) {
00242       pipe_tsd_init(tsd);
00243    }
00244 #if defined(PIPE_OS_LINUX)
00245    return pthread_getspecific(tsd->key);
00246 #elif defined(PIPE_SUBSYSTEM_WINDOWS_USER)
00247    assert(0);
00248    return NULL;
00249 #else
00250    assert(0);
00251    return NULL;
00252 #endif

static void pipe_tsd_init ( pipe_tsd tsd  )  [static]

Definition at line 224 of file p_thread.h.

References assert, pipe_tsd::initMagic, and PIPE_TSD_INIT_MAGIC.

00226 {
00227 #if defined(PIPE_OS_LINUX)
00228    if (pthread_key_create(&tsd->key, NULL/*free*/) != 0) {
00229       perror("pthread_key_create(): failed to allocate key for thread specific data");
00230       exit(-1);
00231    }
00232 #elif defined(PIPE_SUBSYSTEM_WINDOWS_USER)
00233    assert(0);
00234 #endif
00235    tsd->initMagic = PIPE_TSD_INIT_MAGIC;

static void pipe_tsd_set ( pipe_tsd tsd,
void *  value 
) [static]

Definition at line 255 of file p_thread.h.

References assert, pipe_tsd::initMagic, pipe_tsd_init(), and PIPE_TSD_INIT_MAGIC.

00257 {
00258    if (tsd->initMagic != (int) PIPE_TSD_INIT_MAGIC) {
00259       pipe_tsd_init(tsd);
00260    }
00261 #if defined(PIPE_OS_LINUX)
00262    if (pthread_setspecific(tsd->key, value) != 0) {
00263       perror("pthread_set_specific() failed");
00264       exit(-1);
00265    }
00266 #elif defined(PIPE_SUBSYSTEM_WINDOWS_USER)
00267    assert(0);
00268 #else
00269    assert(0);
00270 #endif


Generated on Tue Sep 29 06:25:44 2009 for Gallium3D by  doxygen 1.5.4