Unix port: Give threads a name on Linux

May also work on Darwin, but I can't test it :-)
This commit is contained in:
Dirk Ziegelmeier 2018-11-02 20:22:22 +01:00
parent ba8d9b0018
commit feee9d903a

View File

@ -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);
}