X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=blobdiff_plain;f=source%2Fcore%2Fthread.h;h=7cf17b8d327ed3e84075bb4c247f4c5d16c4ff6f;hp=1fff3627b037287aac89cb8e68e77f15d5543b47;hb=a4596d1c2f627e4568eb6c01d81b6e45f488715a;hpb=1fd05fc0d04adf7441ed3a83089e3b8716a72c20 diff --git a/source/core/thread.h b/source/core/thread.h index 1fff362..7cf17b8 100644 --- a/source/core/thread.h +++ b/source/core/thread.h @@ -1,6 +1,8 @@ #ifndef MSP_CORE_THREAD_H_ #define MSP_CORE_THREAD_H_ +#include + namespace Msp { /** @@ -25,16 +27,19 @@ private: }; Private *priv_; + std::string name_; State state_; protected: - Thread(); + Thread(const std::string & = std::string()); private: Thread(const Thread &); Thread &operator=(const Thread &); public: virtual ~Thread(); + const std::string &get_name() const { return name_; } + /** Indicates whether the thread has finished running. */ bool is_finished() { return state_>=FINISHED; } @@ -54,6 +59,7 @@ private: void platform_join(); void platform_kill(); void platform_launch(); + void platform_setname(); protected: virtual void main() = 0;