threadmm::posix::thread< Client > Class Template Reference
[POSIX threads backend classes]

#include <threadmm/thread.hh>

Collaboration diagram for threadmm::posix::thread< Client >:

Collaboration graph
[legend]
List of all members.

Detailed Description

template<typename Client>
class threadmm::posix::thread< Client >

POSIX thread implementation.

See also:
threadmm::basic_thread


Public Types

typedef Client client_type
typedef ::threadmm::thread_specific<
client_type, thread_create,
thread_cleanup
pool_type

Public Member Functions

 thread (int flags, int policy=regular, int priority=0, int gsize=-1, void *address=0, size_t ssize=0)
virtual ~thread ()
int kind () const
void * stack (size_t &n) const
size_t guard_size () const
int scheduling (int flag, int priority)
int scheduling (int &flag) const
void cancel ()
void detach ()
bool equal (const client_type &other)
void * join ()

Static Public Member Functions

bool at_fork (void(*prep)(), void(*par)(), void(*chi)())
Current-thread manipulators.
void exit (void *retval)
void kill_others ()
int cancellation (int type)
int concurrency ()
int concurrency (int c)
bool disable_cancellation ()
bool enable_cancellation ()
client_typeself ()
void test_cancel ()
void yield ()

Protected Member Functions

 thread ()
void run (client_type *client)

Friends

struct thread_create


Member Typedef Documentation

template<typename Client>
typedef Client threadmm::posix::thread< Client >::client_type
 

Helper structure to set thread data, in case it doesn't exist.

template<typename Client>
typedef ::threadmm::thread_specific<client_type, thread_create, thread_cleanup> threadmm::posix::thread< Client >::pool_type
 


Constructor & Destructor Documentation

template<typename Client>
threadmm::posix::thread< Client >::thread  )  [inline, protected]
 

template<typename Client>
threadmm::posix::thread< Client >::thread int  flags,
int  policy = regular,
int  priority = 0,
int  gsize = -1,
void *  address = 0,
size_t  ssize = 0
[inline]
 

Here is the call graph for this function:

template<typename Client>
threadmm::posix::thread< Client >::~thread  )  [inline, virtual]
 

Here is the call graph for this function:


Member Function Documentation

template<typename Client>
bool threadmm::posix::thread< Client >::at_fork void(*)()  prep,
void(*)()  par,
void(*)()  chi
[inline, static]
 

at fork handlers.

Parameters:
prep Function executed before fork
par Function executed in parent
chi Function executed in child.
Returns:
true if installation succeeded.

template<typename Client>
void threadmm::posix::thread< Client >::cancel  )  [inline]
 

Cancel this thread from another thread.

template<typename Client>
int threadmm::posix::thread< Client >::cancellation int  type  )  [inline, static]
 

Set the cancellation type.

template<typename Client>
int threadmm::posix::thread< Client >::concurrency int  c  )  [inline, static]
 

Set the concurrency of the thread.

template<typename Client>
int threadmm::posix::thread< Client >::concurrency  )  [inline, static]
 

Get the concurrentcy of the thread.

template<typename Client>
void threadmm::posix::thread< Client >::detach  )  [inline]
 

Detach thread.

template<typename Client>
bool threadmm::posix::thread< Client >::disable_cancellation  )  [inline, static]
 

Disable cancellations.

template<typename Client>
bool threadmm::posix::thread< Client >::enable_cancellation  )  [inline, static]
 

Enable cancellations.

template<typename Client>
bool threadmm::posix::thread< Client >::equal const client_type other  )  [inline]
 

Compare two threads for equality.

Parameters:
other Other thread to compare to.
Returns:
true if threads are equal, false otherwise.

template<typename Client>
void threadmm::posix::thread< Client >::exit void *  retval  )  [inline, static]
 

Exit thread.

template<typename Client>
size_t threadmm::posix::thread< Client >::guard_size  )  const [inline]
 

Get the guard parameters.

template<typename Client>
void * threadmm::posix::thread< Client >::join  )  [inline]
 

Join to this thread.

The calling thread is joined to this thread, if this thread is joinable. That is, it is created with the joinable flag set.

Returns:
the return value of the user overloaded thread member function operator().

Here is the call graph for this function:

template<typename Client>
void threadmm::posix::thread< Client >::kill_others  )  [inline, static]
 

Kill all other threads.

template<typename Client>
int threadmm::posix::thread< Client >::kind  )  const [inline]
 

Get the flags.

template<typename Client>
void threadmm::posix::thread< Client >::run client_type client  )  [inline, protected]
 

Start the thread.

Parameters:
client Pointer to client, or user-derived, object.

template<typename Client>
int threadmm::posix::thread< Client >::scheduling int &  flag  )  const [inline]
 

Get the schedluing paramaters.

template<typename Client>
int threadmm::posix::thread< Client >::scheduling int  flag,
int  priority
[inline]
 

Get/Set the scheduling parameters.

template<typename Client>
thread< Client >::client_type & threadmm::posix::thread< Client >::self  )  [inline, static]
 

Get current running thread.

Here is the call graph for this function:

template<typename Client>
void * threadmm::posix::thread< Client >::stack size_t &  n  )  const [inline]
 

Get the stack parameters.

template<typename Client>
void threadmm::posix::thread< Client >::test_cancel  )  [inline, static]
 

Test if we've got a cancel.

template<typename Client>
void threadmm::posix::thread< Client >::yield  )  [inline, static]
 

yield this thread.


Friends And Related Function Documentation

template<typename Client>
friend struct thread_create [friend]
 


The documentation for this class was generated from the following file:
Top of page
Last update Tue Nov 9 12:40:51 2004
Christian Holm
Created by DoxyGen 1.3.9.1