tlds
Transactional Operations for Linked Data Structures
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
thread.h File Reference
#include <pthread.h>
#include <stdlib.h>
#include "types.h"
Include dependency graph for thread.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define THREAD_T   pthread_t
 
#define THREAD_ATTR_T   pthread_attr_t
 
#define THREAD_ATTR_INIT(attr)   pthread_attr_init(&attr)
 
#define THREAD_JOIN(tid)   pthread_join(tid, (void**)NULL)
 
#define THREAD_CREATE(tid, attr, fn, arg)
 
#define THREAD_LOCAL_T   pthread_key_t
 
#define THREAD_LOCAL_INIT(key)   pthread_key_create(&key, NULL)
 
#define THREAD_LOCAL_SET(key, val)   pthread_setspecific(key, (void*)(val))
 
#define THREAD_LOCAL_GET(key)   pthread_getspecific(key)
 
#define THREAD_MUTEX_T   pthread_mutex_t
 
#define THREAD_MUTEX_INIT(lock)   pthread_mutex_init(&(lock), NULL)
 
#define THREAD_MUTEX_LOCK(lock)   pthread_mutex_lock(&(lock))
 
#define THREAD_MUTEX_UNLOCK(lock)   pthread_mutex_unlock(&(lock))
 
#define THREAD_COND_T   pthread_cond_t
 
#define THREAD_COND_INIT(cond)   pthread_cond_init(&(cond), NULL)
 
#define THREAD_COND_SIGNAL(cond)   pthread_cond_signal(&(cond))
 
#define THREAD_COND_BROADCAST(cond)   pthread_cond_broadcast(&(cond))
 
#define THREAD_COND_WAIT(cond, lock)   pthread_cond_wait(&(cond), &(lock))
 
#define THREAD_BARRIER_T   barrier_t
 
#define THREAD_BARRIER_ALLOC(N)   barrier_alloc()
 
#define THREAD_BARRIER_INIT(bar, N)   barrier_init(bar, N)
 
#define THREAD_BARRIER(bar, tid)   barrier_cross(bar)
 
#define THREAD_BARRIER_FREE(bar)   barrier_free(bar)
 

Typedefs

typedef struct barrier barrier_t
 

Functions

barrier_tbarrier_alloc ()
 
void barrier_free (barrier_t *b)
 
void barrier_init (barrier_t *b, int n)
 
void barrier_cross (barrier_t *b)
 
void thread_startup (long numThread)
 
void thread_start (void(*funcPtr)(void *), void *argPtr)
 
void thread_shutdown ()
 
void thread_barrier_wait ()
 
long thread_getId ()
 
long thread_getNumThread ()
 

Macro Definition Documentation

#define THREAD_ATTR_INIT (   attr)    pthread_attr_init(&attr)
#define THREAD_ATTR_T   pthread_attr_t
#define THREAD_BARRIER (   bar,
  tid 
)    barrier_cross(bar)
#define THREAD_BARRIER_ALLOC (   N)    barrier_alloc()
#define THREAD_BARRIER_FREE (   bar)    barrier_free(bar)
#define THREAD_BARRIER_INIT (   bar,
  N 
)    barrier_init(bar, N)
#define THREAD_BARRIER_T   barrier_t
#define THREAD_COND_BROADCAST (   cond)    pthread_cond_broadcast(&(cond))
#define THREAD_COND_INIT (   cond)    pthread_cond_init(&(cond), NULL)
#define THREAD_COND_SIGNAL (   cond)    pthread_cond_signal(&(cond))
#define THREAD_COND_T   pthread_cond_t
#define THREAD_COND_WAIT (   cond,
  lock 
)    pthread_cond_wait(&(cond), &(lock))
#define THREAD_CREATE (   tid,
  attr,
  fn,
  arg 
)
Value:
pthread_create(&(tid), \
&(attr), \
(void* (*)(void*))(fn), \
(void*)(arg))
Definition: intruder.c:122
#define THREAD_JOIN (   tid)    pthread_join(tid, (void**)NULL)
#define THREAD_LOCAL_GET (   key)    pthread_getspecific(key)
#define THREAD_LOCAL_INIT (   key)    pthread_key_create(&key, NULL)
#define THREAD_LOCAL_SET (   key,
  val 
)    pthread_setspecific(key, (void*)(val))
#define THREAD_LOCAL_T   pthread_key_t
#define THREAD_MUTEX_INIT (   lock)    pthread_mutex_init(&(lock), NULL)
#define THREAD_MUTEX_LOCK (   lock)    pthread_mutex_lock(&(lock))
#define THREAD_MUTEX_T   pthread_mutex_t
#define THREAD_MUTEX_UNLOCK (   lock)    pthread_mutex_unlock(&(lock))
#define THREAD_T   pthread_t

Typedef Documentation

typedef struct barrier barrier_t

Function Documentation

barrier_t* barrier_alloc ( )
void barrier_cross ( barrier_t b)
void barrier_free ( barrier_t b)
void barrier_init ( barrier_t b,
int  n 
)
void thread_barrier_wait ( )

Here is the call graph for this function:

Here is the caller graph for this function:

long thread_getId ( )

Here is the caller graph for this function:

long thread_getNumThread ( )

Here is the caller graph for this function:

void thread_shutdown ( )
inline

Here is the call graph for this function:

Here is the caller graph for this function:

void thread_start ( void(*)(void *)  funcPtr,
void *  argPtr 
)

Here is the call graph for this function:

Here is the caller graph for this function:

void thread_startup ( long  numThread)

Here is the call graph for this function:

Here is the caller graph for this function: