summaryrefslogtreecommitdiff
path: root/mysys/my_pthread.c
diff options
context:
space:
mode:
Diffstat (limited to 'mysys/my_pthread.c')
-rw-r--r--mysys/my_pthread.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/mysys/my_pthread.c b/mysys/my_pthread.c
index f10a2210064..2667c0670d8 100644
--- a/mysys/my_pthread.c
+++ b/mysys/my_pthread.c
@@ -102,16 +102,20 @@ void my_pthread_exit(void *status)
NXContext_t ctx;
char name[PATH_MAX] = "";
- NXThreadGetContext(tid, &ctx);
- NXContextGetName(ctx, name, PATH_MAX);
-
- /*
- "MYSQLD.NLM's LibC Reaper" or "MYSQLD.NLM's main thread"
- with a debug build of LibC the reaper can have different names
- */
- if (!strindex(name, "\'s"))
+ /* Do not call pthread_exit if it is not a LibC thread */
+ if (tid != 0)
{
- pthread_exit(status);
+ NXThreadGetContext(tid, &ctx);
+ NXContextGetName(ctx, name, PATH_MAX);
+
+ /*
+ "MYSQLD.NLM's LibC Reaper" or "MYSQLD.NLM's main thread"
+ with a debug build of LibC the reaper can have different names
+ */
+ if (!strindex(name, "\'s"))
+ {
+ pthread_exit(status);
+ }
}
}
#endif