mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-10-05 22:29:49 +00:00
Unix port: Give threads a name on Linux
May also work on Darwin, but I can't test it :-)
This commit is contained in:
parent
ba8d9b0018
commit
feee9d903a
@ -44,6 +44,8 @@
|
||||
* will block until there is more room instead of just
|
||||
* leaking messages.
|
||||
*/
|
||||
#define _GNU_SOURCE /* pull in pthread_setname_np() on Linux */
|
||||
|
||||
#include "lwip/debug.h"
|
||||
|
||||
#include <string.h>
|
||||
@ -190,6 +192,10 @@ sys_thread_new(const char *name, lwip_thread_fn function, void *arg, int stacksi
|
||||
thread_wrapper,
|
||||
thread_data);
|
||||
|
||||
#ifdef LWIP_UNIX_LINUX
|
||||
pthread_setname_np(tmp, name);
|
||||
#endif
|
||||
|
||||
if (0 == code) {
|
||||
st = introduce_thread(tmp);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user