summaryrefslogtreecommitdiffstats
path: root/source/OSSupport/IsThread.h
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2013-08-11 18:46:49 +0200
committermadmaxoft <github@xoft.cz>2013-08-11 18:46:49 +0200
commitb58ca60815a69c49426b69113594125508a914d2 (patch)
treea4065491fba2b97858dbb8141824b0e80cbec6dc /source/OSSupport/IsThread.h
parentDragged in the latest changes for Core. (diff)
downloadcuberite-b58ca60815a69c49426b69113594125508a914d2.tar
cuberite-b58ca60815a69c49426b69113594125508a914d2.tar.gz
cuberite-b58ca60815a69c49426b69113594125508a914d2.tar.bz2
cuberite-b58ca60815a69c49426b69113594125508a914d2.tar.lz
cuberite-b58ca60815a69c49426b69113594125508a914d2.tar.xz
cuberite-b58ca60815a69c49426b69113594125508a914d2.tar.zst
cuberite-b58ca60815a69c49426b69113594125508a914d2.zip
Diffstat (limited to 'source/OSSupport/IsThread.h')
-rw-r--r--source/OSSupport/IsThread.h16
1 files changed, 11 insertions, 5 deletions
diff --git a/source/OSSupport/IsThread.h b/source/OSSupport/IsThread.h
index ed9a32852..2a4451a4a 100644
--- a/source/OSSupport/IsThread.h
+++ b/source/OSSupport/IsThread.h
@@ -26,18 +26,24 @@ In the descending class' constructor call the Start() method to start the thread
class cIsThread
{
protected:
- virtual void Execute(void) = 0; // This function is called in the new thread's context
+ /// This is the main thread entrypoint
+ virtual void Execute(void) = 0;
- volatile bool m_ShouldTerminate; // The overriden Execute() method should check this periodically and terminate if this is true
+ /// The overriden Execute() method should check this value periodically and terminate if this is true
+ volatile bool m_ShouldTerminate;
public:
cIsThread(const AString & iThreadName);
~cIsThread();
- bool Start(void); // Starts the thread
- bool Wait(void); // Waits for the thread to finish
+ /// Starts the thread; returns without waiting for the actual start
+ bool Start(void);
- static unsigned long GetCurrentID(void); // Returns the OS-dependent thread ID for the caller's thread
+ /// Waits for the thread to finish. Doesn't signalize the ShouldTerminate flag
+ bool Wait(void);
+
+ /// Returns the OS-dependent thread ID for the caller's thread
+ static unsigned long GetCurrentID(void);
private:
AString m_ThreadName;