mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-26 02:18:04 +01:00
set thread name (#3664)
* set thread name * fix dead lock * fix code style & return fake name * fix code style * fix code style Co-authored-by: Aleksandar Fabijanic <aleks-f@users.noreply.github.com>
This commit is contained in:
@@ -36,10 +36,8 @@
|
||||
#include <cstring>
|
||||
#endif
|
||||
|
||||
|
||||
namespace Poco {
|
||||
|
||||
|
||||
class Foundation_API ThreadImpl
|
||||
{
|
||||
public:
|
||||
@@ -64,6 +62,12 @@ public:
|
||||
~ThreadImpl();
|
||||
|
||||
TIDImpl tidImpl() const;
|
||||
void setNameImpl(const std::string& threadName);
|
||||
std::string getNameImpl() const;
|
||||
std::string getOSThreadNameImpl();
|
||||
/// Returns the thread's name, expressed as an operating system
|
||||
/// specific name value. Return empty string if thread is not running.
|
||||
/// For test used only.
|
||||
void setPriorityImpl(int prio);
|
||||
int getPriorityImpl() const;
|
||||
void setOSPriorityImpl(int prio, int policy = SCHED_OTHER);
|
||||
@@ -141,6 +145,7 @@ private:
|
||||
std::size_t stackSize;
|
||||
bool started;
|
||||
bool joined;
|
||||
std::string name;
|
||||
mutable FastMutex mutex;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user