setthreadname

Gives a name to the specified thread.

Library:LibC
Service:Library

Syntax

  #include <library.h> 
   
  int setthreadname (
     void        *threadid,
     const char   *name);
  

Parameters

threadid

(IN) Points to the ID of a thread obtained by calling getthreadid. If NULL, uses the ID of the thread of the calling process.

name

(IN) Points to the name for the thread (up to 17 characters).

Return Values

If successful, returns 0; otherwise, returns EBADHNDL if you pass an invalid thread ID.

Remarks

The getthreadid, getthreadname, and setthreadname functions are designed to help you debug a multithreaded application. In the debugger, you can see thread names.

These functions can be used on all types of threads: UI, pthread, and NKS.

See Also