diff options
Diffstat (limited to 'gdb/thread.c')
-rw-r--r-- | gdb/thread.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/gdb/thread.c b/gdb/thread.c index 3090b69..5a78ad1 100644 --- a/gdb/thread.c +++ b/gdb/thread.c @@ -125,8 +125,8 @@ clear_thread_inferior_resources (struct thread_info *tp) bpstat_clear (&tp->control.stop_bpstat); - discard_all_intermediate_continuations_thread (tp); - discard_all_continuations_thread (tp); + do_all_intermediate_continuations_thread (tp, 1); + do_all_continuations_thread (tp, 1); delete_longjmp_breakpoint (tp->num); } @@ -134,8 +134,6 @@ clear_thread_inferior_resources (struct thread_info *tp) static void free_thread (struct thread_info *tp) { - clear_thread_inferior_resources (tp); - if (tp->private) { if (tp->private_dtor) @@ -297,15 +295,19 @@ delete_thread_1 (ptid_t ptid, int silent) return; } + /* Notify thread exit, but only if we haven't already. */ + if (tp->state_ != THREAD_EXITED) + observer_notify_thread_exit (tp, silent); + + /* Tag it as exited. */ + tp->state_ = THREAD_EXITED; + clear_thread_inferior_resources (tp); + if (tpprev) tpprev->next = tp->next; else thread_list = tp->next; - /* Notify thread exit, but only if we haven't already. */ - if (tp->state_ != THREAD_EXITED) - observer_notify_thread_exit (tp, silent); - free_thread (tp); } |