C-Thread-Pool
C-Thread-Pool copied to clipboard
Added `pthread_set_name_np` for FreeBSD and OpenBSD
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
FWIW, this seems to also be supported in linux: https://man7.org/linux/man-pages/man3/pthread_setname_np.3.html
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.
Similar implementation in https://github.com/Pithikos/C-Thread-Pool/pull/103 tested on Linux
Can't merge due to deleted account/repo. I've added the changes here: https://github.com/Pithikos/C-Thread-Pool/pull/130