SigCX::Threads::Thread Class Reference
[Threading]

Thread class. More...

#include <thread.h>

List of all members.

Public Types

enum  Priority

Public Member Functions

 Thread (const SigC::Slot0< void > &slot, bool joinable=false)
 Thread (const SigC::Slot0< void > &slot, unsigned long stacksize, bool joinable, bool bound, Priority priority=Normal)
 Thread (const Thread &th)
 ~Thread ()
Threadoperator= (const Thread &th)
bool join ()
bool operator== (const Thread &th) const
bool operator!= (const Thread &th) const

Static Public Member Functions

static Thread self ()

Classes

class  Exit
 Thread exit exception. More...


Detailed Description

Thread class.

Class representing a thread (lightweight process).


Member Enumeration Documentation

enum SigCX::Threads::Thread::Priority

Thread priorities.


Constructor & Destructor Documentation

SigCX::Threads::Thread::Thread ( const SigC::Slot0< void > &  slot,
bool  joinable = false 
)

Constructor.

Create a new thread, using slot as main function.

Parameters:
slot Invoked as main function of the thread.
joinable Wether the thread should be joinable or detached.

SigCX::Threads::Thread::Thread ( const SigC::Slot0< void > &  slot,
unsigned long  stacksize,
bool  joinable,
bool  bound,
Priority  priority = Normal 
)

Constructor.

Create a new thread, using slot as main function. In general, avoid using this constructor, when you can use Thread::Thread(joinable).

Parameters:
slot Invoked as main function of the thread.
stacksize Initial stacksize for the thread (system default if stacksize == 0).
joinable Wether the thread should be joinable or detached.
bound If true, this thread will be scheduled in the system scope, otherwise the implementation is free to do scheduling in the process scope. The first variant is more expensive resource-wise, but generally faster. On some systems (e.g. Linux) all threads are bound.
priority One of Low, Normal, High, Urgent. It is not guaranteed, that threads with different priorities really behave accordingly. On some systems (e.g. Linux) only root can increase priorities. On other systems (e.g. Solaris) there doesn't seem to be different scheduling for different priorities. All in all try to avoid being dependent on priorities. Use Normal here as a default.

SigCX::Threads::Thread::Thread ( const Thread th  ) 

Copy constructor.

SigCX::Threads::Thread::~Thread (  ) 

Destructor.


Member Function Documentation

Thread& SigCX::Threads::Thread::operator= ( const Thread th  ) 

Assignment operator.

bool SigCX::Threads::Thread::join (  ) 

Join thread.

Waits until the thread finishes., i.e. Thread::main(arg) returns. All resources of thread are released. The thread must have been created with joinable == true in the constructor.

Returns:
true on success.

bool SigCX::Threads::Thread::operator== ( const Thread th  )  const [inline]

Check for Thread equality.

Parameters:
th Thread to check for equality.
Returns:
true if *this and th are equal.

bool SigCX::Threads::Thread::operator!= ( const Thread th  )  const [inline]

Check for Thread unequality.

Parameters:
th Thread to check for unequality.
Returns:
true if *this and th are not equal.

static Thread SigCX::Threads::Thread::self (  )  [static]

Get current thread.

Returns:
A Thread object representing the thread of the caller.


The documentation for this class was generated from the following file:
Generated on Mon Sep 10 06:27:37 2007 for SigCX - SigC++ Extras by  doxygen 1.5.3