Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

xthread.h File Reference

#include <pthread.h>
#include <pisystem.h>
#include <pithread-if.h>

Include dependency graph for xthread.h:

Include dependency graph

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

Included by dependency graph

Go to the source code of this file.

Defines

#define CREATE_ATT   extern PI_API
#define GENERAL_ATT   static PI_INLINE PI_API

Typedefs

typedef pthread_t pithread_t
 The thread type. More...

typedef pthread_attr_t pithread_attr_t
 The thread attribute type. More...

typedef pthread_mutex_t pithread_mutex_t
 The mutex type. More...

typedef pthread_mutexattr_t pithread_mutexattr_t
 The mutex attribute type. More...

typedef pthread_cond_t pithread_cond_t
 The condition type. More...

typedef pthread_condattr_t pithread_condattr_t
 The condition attribute type. More...


Functions

GENERAL_ATT pithread_t pithread_self (void)
 Obtain the identifier of the current thread. More...

GENERAL_ATT int pithread_equal (pithread_t __thread1, pithread_t __thread2)
 Compare two thread identifiers. More...

GENERAL_ATT void pithread_exit (void *__retval)
 Terminate calling thread. More...

GENERAL_ATT int pithread_join (pithread_t __th, void **__thread_return)
 Make calling thread wait for termination of another thread. More...

GENERAL_ATT int pithread_cancel (pithread_t __thread)
 Cancel given thread immediately or at the next possibility. More...

GENERAL_ATT int pithread_mutex_init (pithread_mutex_t *__mutex, const pithread_mutexattr_t *__mutex_attr)
 Initialize a mutex. More...

GENERAL_ATT int pithread_mutex_destroy (pithread_mutex_t *__mutex)
 Destroy mutex. More...

GENERAL_ATT int pithread_mutex_trylock (pithread_mutex_t *__mutex)
 Try to lock mutex (non-blocking). More...

GENERAL_ATT int pithread_mutex_lock (pithread_mutex_t *__mutex)
 Wait until lock for mutex becomes available and lock it. More...

GENERAL_ATT int pithread_mutex_unlock (pithread_mutex_t *__mutex)
 Unlock mutex. More...

GENERAL_ATT int pithread_cond_init (pithread_cond_t *__cond, const pithread_condattr_t *__cond_attr)
 Initialize condition variable. More...

GENERAL_ATT int pithread_cond_destroy (pithread_cond_t *__cond)
 Destroy condition variable. More...

GENERAL_ATT int pithread_cond_signal (pithread_cond_t *__cond)
 Wake up one thread waiting for condition variable. More...

GENERAL_ATT int pithread_cond_broadcast (pithread_cond_t *__cond)
 Wake up all threads waiting for condition variable. More...

GENERAL_ATT int pithread_cond_wait (pithread_cond_t *__cond, pithread_mutex_t *__mutex)
 Wait for condition variable to be signaled or broadcast. More...

GENERAL_ATT void pithread_yield ()


Define Documentation

#define CREATE_ATT   extern PI_API
 

#define GENERAL_ATT   static PI_INLINE PI_API
 


Typedef Documentation

typedef pthread_attr_t pithread_attr_t
 

The thread attribute type.

typedef pthread_cond_t pithread_cond_t
 

The condition type.

typedef pthread_condattr_t pithread_condattr_t
 

The condition attribute type.

typedef pthread_mutex_t pithread_mutex_t
 

The mutex type.

typedef pthread_mutexattr_t pithread_mutexattr_t
 

The mutex attribute type.

typedef pthread_t pithread_t
 

The thread type.


Function Documentation

GENERAL_ATT int pithread_cancel pithread_t    __thread
 

Cancel given thread immediately or at the next possibility.

Returns:
0 on success, else error.

GENERAL_ATT int pithread_cond_broadcast pithread_cond_t   __cond
 

Wake up all threads waiting for condition variable.

Parameters:
__cond  the condition variable
Returns:
0 on success, else error.
Bug:
currently unused.

GENERAL_ATT int pithread_cond_destroy pithread_cond_t   __cond
 

Destroy condition variable.

Parameters:
__cond  the condition variable
Returns:
0 on success, else error.

GENERAL_ATT int pithread_cond_init pithread_cond_t   __cond,
const pithread_condattr_t   __cond_attr
 

Initialize condition variable.

Parameters:
__cond  condition variable to be initialized
__cond_attr  attributes to use (default values if NULL)
Returns:
0 on success, else error.

GENERAL_ATT int pithread_cond_signal pithread_cond_t   __cond
 

Wake up one thread waiting for condition variable.

Parameters:
__cond  the condition variable
Returns:
0 on success, else error.

GENERAL_ATT int pithread_cond_wait pithread_cond_t   __cond,
pithread_mutex_t   __mutex
 

Wait for condition variable to be signaled or broadcast.

Parameters:
__cond  The condition variable.
__mutex  The mutex (assumed to be locked before).
Returns:
0 on success, else error.

GENERAL_ATT int pithread_equal pithread_t    __thread1,
pithread_t    __thread2
 

Compare two thread identifiers.

Returns:
nonzero if they refer to the same thread, else zero

GENERAL_ATT void pithread_exit void *    __retval
 

Terminate calling thread.

Parameters:
__retval  Thread return value

GENERAL_ATT int pithread_join pithread_t    __th,
void **    __thread_return
 

Make calling thread wait for termination of another thread.

Parameters:
__th  thread to wait for.
__thread_return  storage area for thread return value or NULL.
Returns:
0 on success, else error.

GENERAL_ATT int pithread_mutex_destroy pithread_mutex_t   __mutex
 

Destroy mutex.

Parameters:
__mutex  The mutex.
Returns:
0 on success, else error.

GENERAL_ATT int pithread_mutex_init pithread_mutex_t   __mutex,
const pithread_mutexattr_t   __mutex_attr
 

Initialize a mutex.

Parameters:
__mutex  Mutex to initialize
__mutex_attr  Attributes to use (default values if NULL).
Returns:
0 on success, else error.

GENERAL_ATT int pithread_mutex_lock pithread_mutex_t   __mutex
 

Wait until lock for mutex becomes available and lock it.

Parameters:
__mutex  The mutex.
Returns:
0 on success, else error.

GENERAL_ATT int pithread_mutex_trylock pithread_mutex_t   __mutex
 

Try to lock mutex (non-blocking).

Parameters:
__mutex  The mutex.
Returns:
0 on success, else error.

GENERAL_ATT int pithread_mutex_unlock pithread_mutex_t   __mutex
 

Unlock mutex.

Parameters:
__mutex  The mutex.
Returns:
0 on success, else error.

GENERAL_ATT pithread_t pithread_self void   
 

Obtain the identifier of the current thread.

GENERAL_ATT void pithread_yield  
 

Yield the remainder of the current timeslice to other threads/processes.


Generated on Mon Sep 30 15:54:04 2002 for PointShop by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002