summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--winsup/cygwin/cygthread.cc4
-rw-r--r--winsup/cygwin/release/2.12.02
2 files changed, 4 insertions, 2 deletions
diff --git a/winsup/cygwin/cygthread.cc b/winsup/cygwin/cygthread.cc
index 4404e4a19..66a317934 100644
--- a/winsup/cygwin/cygthread.cc
+++ b/winsup/cygwin/cygthread.cc
@@ -87,6 +87,7 @@ cygthread::stub (VOID *arg)
#endif
else
{
+ SetThreadName (info->id, info->__name);
info->callfunc (false);
HANDLE notify = info->notify_detached;
@@ -128,6 +129,7 @@ cygthread::simplestub (VOID *arg)
_my_tls._ctinfo = info;
info->stack_ptr = &arg;
HANDLE notify = info->notify_detached;
+ SetThreadName (info->id, info->__name);
info->callfunc (true);
if (notify)
SetEvent (notify);
@@ -213,8 +215,6 @@ cygthread::create ()
this, 0, &id);
if (!htobe)
api_fatal ("CreateThread failed for %s - %p<%y>, %E", __name, h, id);
- else
- SetThreadName (GetThreadId (htobe), __name);
thread_printf ("created name '%s', thread %p, id %y", __name, h, id);
#ifdef DEBUGGING
terminated = false;
diff --git a/winsup/cygwin/release/2.12.0 b/winsup/cygwin/release/2.12.0
index af74b099e..c847b91c0 100644
--- a/winsup/cygwin/release/2.12.0
+++ b/winsup/cygwin/release/2.12.0
@@ -77,3 +77,5 @@ Bug Fixes
- Fix WEOF handling in wctype functions.
Addresses: https://cygwin.com/ml/cygwin/2018-12/msg00173.html
+
+- Fix thread names in GDB when cygthreads get reused.