CTR Pia
4.11.3
Game Communication Engine
|
Represents a job scheduler. More...
Public Member Functions | |
void | Dispatch (u32 timeout=0) |
Dispatches jobs. More... | |
virtual void | Trace (u64 flag) const |
Prints information that is useful for debugging. More... | |
Static Public Member Functions | |
static nn::Result | CreateInstance (s32 backgroundThreadPriority=DEFAULT_BACKGROUND_THREAD_PRIORITY) |
Creates an instance (singleton pattern). More... | |
static void | DestroyInstance () |
Destroys the instance (singleton pattern). More... | |
static Scheduler * | GetInstance () |
Gets a pointer to the Scheduler instance (singleton pattern). More... | |
Static Public Attributes | |
static const s32 | DEFAULT_BACKGROUND_THREAD_PRIORITY = 24 |
Specifies the default priority value threads used by the background scheduler. | |
Represents a job scheduler.
The scheduler object is used to asynchronously execute processes defined by the Job
class. This class is not thread-safe.
2014-09-18 Changed the specifications so that ResultAlreadyExists
is returned if you call CreateInstance
when an instance already exists.
2012-07-03 Changed the background scheduler priority check.
2012-06-15 The Dispatch
function used to return nn::Result
, but no longer returns a value.
2012-05-21 Added a feature for running jobs in a different thread. The parameters and return values of CreateInstance
have been changed accordingly.
2012-04-04 Initial version.
|
static |
Creates an instance (singleton pattern).
Call this member function after calling nn::pia::common::BeginSetup
, but before calling nn::pia::common::EndSetup
.
[in] | backgroundThreadPriority | Specifies the priority of the thread used by the background scheduler. Be sure to specify a priority lower than the thread used to call Pia member functions. |
Result
value that indicates success if the instance is created successfully. You must make sure that the implementation of this function in your application does not return any errors. ResultAlreadyExists
Indicates that an instance has already been created. Programming error. Fix your program so that this error is not returned.
ResultNotInitialized
The common
module has not been initialized. Programming error. Fix your program so that this error is not returned.
ResultInvalidState
Indicates that the function was not called between the BeginSetup
and EndSetup
functions. Programming error. Fix your program so that this error is not returned.
ResultInvalidArgument
Indicates an argument is invalid. Programming error. Fix your program so that this error is not returned.
|
static |
Destroys the instance (singleton pattern).
If this function is called when an instance has not been created, it does nothing and returns.
void nn::pia::common::Scheduler::Dispatch | ( | u32 | timeout = 0 | ) |
Dispatches jobs.
Jobs are run by calling this function.
[in] | timeout | Specifies the timeout value serving as the upper limit for job execution. The value is in milliseconds. There is, however, no guarantee that jobs will occur within the timeout period. A value of zero is interpreted as if no timeout was specified. |
|
inlinestatic |
Gets a pointer to the Scheduler
instance (singleton pattern).
NULL
pointer if the instance cannot be created.
|
virtual |
Prints information that is useful for debugging.
[in] | flag | Specifies the bitwise OR of trace flags. For more information, see the TraceFlag type. |