ThreadWeaver
Classes | |
class | DependencyPolicy |
DependencyPolicy implements the way dependencies between Jobs are handled. More... | |
class | DestructedState |
DestructedState is only active after the thread have been destroyed by the destructor, but before superclass destructors have finished. More... | |
class | InConstructionState |
InConstructionState handles the calls to the WeaverImpl object until the constructor has finished. More... | |
class | Job |
A Job is a simple abstraction of an action that is to be executed in a thread context. More... | |
class | JobCollection |
A JobCollection is a vector of Jobs that will be queued together. More... | |
class | JobCollectionJobRunner |
class | JobRunHelper |
class | JobSequence |
A JobSequence is a vector of Jobs that will be executed in a sequence. More... | |
class | QueuePolicy |
QueuePolicy is an interface for customizations of the queueing behaviour of sets of jobs. More... | |
class | ResourceRestrictionPolicy |
ResourceRestrictionPolicy is used to limit the number of concurrent accesses to the same resource. More... | |
class | ShuttingDownState |
ShuttingDownState is enabled when the Weaver destructor is entered. More... | |
class | State |
We use a State pattern to handle the system state in ThreadWeaver. More... | |
class | StateImplementation |
class | SuspendedState |
In SuspendedState, jobs are queued, but will not be executed. More... | |
class | SuspendingState |
SuspendingState is the state after suspend() has been called, but before all threads finished executing the current job and blocked. More... | |
class | Thread |
The class Thread is used to represent the worker threads in the weaver's inventory. More... | |
class | ThreadRunHelper |
class | Weaver |
The Weaver class provides the public implementation of the WeaverInterface. More... | |
class | WeaverImpl |
A WeaverImpl is the manager of worker threads (Thread objects) to which it assigns jobs from its queue. More... | |
class | WeaverInterface |
WeaverInterface provides a common interface for weaver implementations. More... | |
class | WeaverObserver |
Observers provides signals on some Weaver events that are otherwise only available through objects of different classes (threads, jobs). More... | |
class | WorkingHardState |
Enumerations | |
enum | StateId { InConstruction = 0, WorkingHard, Suspending, Suspended, ShuttingDown, Destructed, NoOfStates } |
Functions | |
void | debug (int severity, const char *cformat,...) |
void | debug (bool condition, int severity, const char *cformat,...) |
bool | invariant () |
void | setDebugLevel (bool debug, int level) |
Variables | |
bool | Debug = true |
int | DebugLevel = 01 |
QMutex | GlobalMutex |
Enumeration Type Documentation
All weaver objects maintain a state of operation which can be queried by the application.
See the threadweaver documentation on how the different states are related.
State is not part of the published API.
- Enumerator:
InConstruction The object is in the state of construction and has not yet started to process jobs.
WorkingHard Jobs are being processed.
Suspending Job processing is suspended, but some jobs which where already in progress are not finished yet.
Suspended Job processing is suspended, and no jobs are being processed.
ShuttingDown The object is being destructed.
Jobs might still be processed, the destructor will wait for all threads to exit and then end.
Destructed The object is being destructed, and all threads have exited.
No jobs are handled anymore.
NoOfStates Not a state, but a sentinel for the number of defined states.
Function Documentation
|
inline |
This method prints a text message on the screen, if debugging is
enabled.
Otherwise, it does nothing. The message is thread safe, therefore providing that the messages appear in the order they where issued by the different threads. All messages are suppressed when Debug is false. All messages with a lower importance (higher number) than DebugLevel will be suppressed, too. Debug level 0 messages will always be printed as long as Debug is true. We use our own debugging method, since debugging threads is a more complicated experience than debugging single threaded contexts. This might change in future in the way that debug prints its messages to another logging facility provided by the platform. Use setDebugLevel () to integrate adapt debug () to your platform.
Definition at line 112 of file DebuggingAids.h.
|
inline |
Prints the message to the console if condition is true.
Definition at line 125 of file DebuggingAids.h.
|
inline |
Definition at line 142 of file DebuggingAids.h.
|
inline |
Variable Documentation
bool ThreadWeaver::Debug = true |
Definition at line 38 of file DebuggingAids.cpp.
int ThreadWeaver::DebugLevel = 01 |
Definition at line 39 of file DebuggingAids.cpp.
QMutex ThreadWeaver::GlobalMutex |
A global mutex for the ThreadWeaver objects.
Generally, you should not use it in your own code.
Definition at line 37 of file DebuggingAids.cpp.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Tue Jul 16 2013 17:49:04 by doxygen 1.8.1.1 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.