New empth_name() and empth_set_name()
This commit is contained in:
parent
2e5915dd09
commit
2ddeda99d0
6 changed files with 88 additions and 0 deletions
|
@ -486,6 +486,27 @@ empth_self(void)
|
|||
return pThread;
|
||||
}
|
||||
|
||||
/************************
|
||||
* empth_name
|
||||
*/
|
||||
char *
|
||||
empth_name(void)
|
||||
{
|
||||
return empth_self()->szName;
|
||||
}
|
||||
|
||||
/************************
|
||||
* empth_set_name
|
||||
* Set the thread name
|
||||
*/
|
||||
void
|
||||
empth_set_name(char *name)
|
||||
{
|
||||
empth_t *pThread = TlsGetValue(dwTLSIndex);
|
||||
|
||||
strncpy(pThread->szName, name, sizeof(pThread->szName) - 1);
|
||||
}
|
||||
|
||||
/************************
|
||||
* empth_exit
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue