Skip to content

Commit a9cd8ba

Browse files
authored
Set posix thread name for debug build (#3657)
1 parent 3b56e7c commit a9cd8ba

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

core/shared/platform/common/posix/posix_thread.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,13 @@ os_thread_wrapper(void *arg)
4848
#endif
4949
#ifdef OS_ENABLE_WAKEUP_BLOCKING_OP
5050
os_end_blocking_op();
51+
#endif
52+
#if BH_DEBUG != 0
53+
#if defined __APPLE__
54+
pthread_setname_np("wamr");
55+
#else
56+
pthread_setname_np(pthread_self(), "wamr");
57+
#endif
5158
#endif
5259
start_func(thread_arg);
5360
#ifdef OS_ENABLE_HW_BOUND_CHECK

0 commit comments

Comments
 (0)