thread.h File Reference

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <pthread.h>
#include "lscp/version.h"

Go to the source code of this file.

Defines

#define lscp_mutex_init(m)   pthread_mutex_init(&(m), NULL)
#define lscp_mutex_destroy(m)   pthread_mutex_destroy(&(m))
#define lscp_mutex_lock(m)   pthread_mutex_lock(&(m))
#define lscp_mutex_unlock(m)   pthread_mutex_unlock(&(m))
#define lscp_cond_init(c)   pthread_cond_init(&(c), NULL)
#define lscp_cond_destroy(c)   pthread_cond_destroy(&(c))
#define lscp_cond_wait(c, m)   pthread_cond_wait(&(c), &(m))
#define lscp_cond_signal(c)   pthread_cond_signal(&(c))
#define lscp_thread_exit()   pthread_exit(NULL)

Typedefs

typedef enum _lscp_status_t lscp_status_t
typedef pthread_mutex_t lscp_mutex_t
typedef pthread_cond_t lscp_cond_t
typedef void(*) lscp_thread_proc_t (void *pvData)
typedef _lscp_thread_t lscp_thread_t

Enumerations

enum  _lscp_status_t {
  LSCP_OK = 0, LSCP_FAILED = -1, LSCP_ERROR = -2, LSCP_WARNING = -3,
  LSCP_TIMEOUT = -4, LSCP_QUIT = -5
}

Functions

lscp_thread_tlscp_thread_create (lscp_thread_proc_t pfnProc, void *pvData, int iDetach)
lscp_status_t lscp_thread_join (lscp_thread_t *pThread)
lscp_status_t lscp_thread_cancel (lscp_thread_t *pThread)
lscp_status_t lscp_thread_destroy (lscp_thread_t *pThread)


Define Documentation

#define lscp_cond_destroy (  )     pthread_cond_destroy(&(c))

#define lscp_cond_init (  )     pthread_cond_init(&(c), NULL)

#define lscp_cond_signal (  )     pthread_cond_signal(&(c))

#define lscp_cond_wait ( c,
 )     pthread_cond_wait(&(c), &(m))

#define lscp_mutex_destroy (  )     pthread_mutex_destroy(&(m))

#define lscp_mutex_init (  )     pthread_mutex_init(&(m), NULL)

#define lscp_mutex_lock (  )     pthread_mutex_lock(&(m))

#define lscp_mutex_unlock (  )     pthread_mutex_unlock(&(m))

 
#define lscp_thread_exit (  )     pthread_exit(NULL)


Typedef Documentation

typedef pthread_cond_t lscp_cond_t

typedef pthread_mutex_t lscp_mutex_t

typedef enum _lscp_status_t lscp_status_t

typedef void(*) lscp_thread_proc_t(void *pvData)

typedef struct _lscp_thread_t lscp_thread_t


Enumeration Type Documentation

enum _lscp_status_t

Enumerator:
LSCP_OK 
LSCP_FAILED 
LSCP_ERROR 
LSCP_WARNING 
LSCP_TIMEOUT 
LSCP_QUIT 


Function Documentation

lscp_status_t lscp_thread_cancel ( lscp_thread_t pThread  ) 

lscp_thread_t* lscp_thread_create ( lscp_thread_proc_t  pfnProc,
void *  pvData,
int  iDetach 
)

lscp_status_t lscp_thread_destroy ( lscp_thread_t pThread  ) 

lscp_status_t lscp_thread_join ( lscp_thread_t pThread  ) 


Generated on Thu May 20 03:17:57 2010 for liblscp by  doxygen 1.5.2