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

Added `pthread_set_name_np` for FreeBSD and OpenBSD

Open ghost opened this issue 7 years ago • 2 comments

I noticed that for Linux and Mac there was a way to set the thread name, so I add the respective function call for FreeBSD and OpenBSD.

The semantic of ptread_set_name_np is similar to Mac's pthread_setname_np.

Although this function isn't POSIX, the semantic is the same both on OpenBSD and FreeBSD (documentation respectively here and here).

Tested on FreeBSD 11.1-RELEASE-p4 and OpenBSD 6.4

ghost avatar Jan 03 '18 22:01 ghost

FWIW, this seems to also be supported in linux: https://man7.org/linux/man-pages/man3/pthread_setname_np.3.html

gonzus avatar Jul 20 '20 15:07 gonzus

Bummer, the original submitter's account is deleted. If anybody can check whether this works as is on linux, or whether it requires any additional changes, I can merge the PR.

gonzus avatar Jul 21 '20 08:07 gonzus

Similar implementation in https://github.com/Pithikos/C-Thread-Pool/pull/103 tested on Linux

Pithikos avatar Dec 18 '23 13:12 Pithikos

Can't merge due to deleted account/repo. I've added the changes here: https://github.com/Pithikos/C-Thread-Pool/pull/130

Pithikos avatar Dec 18 '23 14:12 Pithikos