|
Nebula
|
#include <jobs.h>
Inherits Thread.
Classes | |
| struct | JobThreadCommand |
Public Types | |
| enum | JobThreadCommandType { RunJob , Signal , Wait , WaitAndReset } |
Public Member Functions | |
| JobThread () | |
| constructor | |
| virtual | ~JobThread () |
| destructor | |
| void | EmitWakeupSignal () |
| called if thread needs a wakeup call before stopping | |
| void | DoWork () |
| this method runs in the thread context | |
| bool | HasWork () |
| returns true if thread has work | |
| void | RunJobSlices (uint sliceIndex, uint numSlices, const JobContext ctx, void(*JobFunc)(const JobFuncContext &ctx), const std::function< void()> *callback) |
| push a set of job slices | |
| void | PushCommand (const JobThreadCommand &command) |
| push command buffer work | |
| void | PushCommands (const Util::Array< JobThreadCommand > &commands) |
| push command buffer work | |
Private Member Functions | |
| __DeclareClass (JobThread) | |
Private Attributes | |
| Threading::SafeQueue< JobThreadCommand > | commands |
| ubyte * | scratchBuffer |
Static Private Attributes | |
| static const SizeT | MaxScratchSize = (64 * 1024) |
| Jobs::JobThread::JobThread | ( | ) |
constructor
|
virtual |
destructor
|
private |
| void Jobs::JobThread::DoWork | ( | ) |
this method runs in the thread context
| void Jobs::JobThread::EmitWakeupSignal | ( | ) |
called if thread needs a wakeup call before stopping
| bool Jobs::JobThread::HasWork | ( | ) |
returns true if thread has work
| void Jobs::JobThread::PushCommand | ( | const JobThreadCommand & | command | ) |
push command buffer work
| void Jobs::JobThread::PushCommands | ( | const Util::Array< JobThreadCommand > & | commands | ) |
push command buffer work
| void Jobs::JobThread::RunJobSlices | ( | uint | sliceIndex, |
| uint | numSlices, | ||
| const JobContext | ctx, | ||
| void(* | JobFunc )(const JobFuncContext &ctx), | ||
| const std::function< void()> * | callback ) |
push a set of job slices
|
private |
|
staticprivate |
|
private |