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:
JackyWoo
2022-07-18 18:21:33 +08:00
committed by GitHub
parent 2a36359bc7
commit 1d28d2d42d
12 changed files with 240 additions and 60 deletions

View File

@@ -70,6 +70,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 = 0);
@@ -111,11 +117,12 @@ protected:
Runnable* pRunnableTarget;
AutoPtr<CallbackData> pCallbackTarget;
int task;
int prio;
int osPrio;
Event done;
int stackSize;
int task;
int prio;
int osPrio;
Event done;
int stackSize;
std::string name;
};
private: