![]() |
CloudBuilder C++ SDK
v3.0.0
Making social games is easy !
|
#include <CotCHelpers.h>
Public Member Functions | |
bool | Start () |
bool | Join () |
bool | HasFinished () |
![]() | |
void | Retain () |
void | Release () |
CRefClass (const CRefClass &other) | |
CRefClass & | operator= (const CRefClass &other) |
Protected Member Functions | |
virtual void | Run ()=0 |
Additional Inherited Members | |
![]() | |
template<class T > | |
static T * | Retain (T *t) |
template<class T > | |
static T * | Release (T *t) |
![]() | |
unsigned | __ref_count |
Simple thread. Just provide an implementation for the Run() method and start it by calling Start() on the resulting instance. This is a CRefClass, meaning that you need to call Release() on it when you are done using it. Do not delete it directly (if the thread is being run, your program will crash). To start a task and forget about it, you may do as follows:
|
inline |
bool CotCHelpers::CThread::Join | ( | ) |
Joins with the thread, waiting for it to end and returning only once done.
|
protectedpure virtual |
Override and implement your threaded work in this method. Never call this directly, use RunForInternalUse instead.
bool CotCHelpers::CThread::Start | ( | ) |
Starts the execution of the thread (instantiating is not enough). Note that starting a thread automatically Retains it until execution finishes.