C-Thread-Pool icon indicating copy to clipboard operation
C-Thread-Pool copied to clipboard

fix: limit thread name length to 16bytes

Open zlrs opened this issue 3 years ago • 0 comments

Thread name should not exceed 16 bytes according to prctl API documentation.

   PR_SET_NAME (since Linux 2.6.9)
          Set the name of the calling thread, using the value in the
          location pointed to by (char *) arg2.  The name can be up
          to 16 bytes long, including the terminating null byte.
          (If the length of the string, including the terminating
          null byte, exceeds 16 bytes, the string is silently
          truncated.)  This is the same attribute that can be set
          via pthread_setname_np(3) and retrieved using
          pthread_getname_np(3).  The attribute is likewise
          accessible via /proc/self/task/[tid]/comm (see proc(5)),
          where [tid] is the thread ID of the calling thread, as
          returned by gettid(2).

zlrs avatar Apr 29 '21 07:04 zlrs