]> Kevux Git Server - fll/commit
Feature: Add f_thread_name_set() and f_thread_name_get().
authorKevin Day <Kevin@kevux.org>
Sat, 2 Aug 2025 03:40:19 +0000 (22:40 -0500)
committerKevin Day <Kevin@kevux.org>
Sat, 2 Aug 2025 03:40:19 +0000 (22:40 -0500)
commit374ab70db9f716e63aab7d895316ad3863d151fe
tree9ece643cdfe1544f02d604a8421003a0c0dd71c3
parentb9bf65b589daafa2c7db4f0cbe4d6ca9651b6695
Feature: Add f_thread_name_set() and f_thread_name_get().

These provide support for `pthread_setname_np()` and `pthread_getname_np(0)` respectively.

These pthread functions are not portable so provide the following variables to gracefully disable the calls:
  - `_pthread_setname_np_unsupported_`
  - `_pthread_getname_np_unsupported_`

The newly added functions return `F_implement_not` when these unsupported defines are set.
This allows for programs that call these to not really care if the thread naming support is present.
They can call the function and if it works, then it works and if it doesn't work, then it doesn't work.
16 files changed:
build/level_0/settings
build/monolithic/settings
level_0/f_thread/c/thread.c
level_0/f_thread/c/thread.h
level_0/f_thread/data/build/defines
level_0/f_thread/data/build/settings
level_0/f_thread/data/build/settings-mocks
level_0/f_thread/data/build/settings-tests
level_0/f_thread/tests/unit/c/mock-thread.c
level_0/f_thread/tests/unit/c/mock-thread.h
level_0/f_thread/tests/unit/c/test-thread-name_get.c [new file with mode: 0644]
level_0/f_thread/tests/unit/c/test-thread-name_get.h [new file with mode: 0644]
level_0/f_thread/tests/unit/c/test-thread-name_set.c [new file with mode: 0644]
level_0/f_thread/tests/unit/c/test-thread-name_set.h [new file with mode: 0644]
level_0/f_thread/tests/unit/c/test-thread.c
level_0/f_thread/tests/unit/c/test-thread.h