aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbthread.h
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/gdbthread.h')
-rw-r--r--gdb/gdbthread.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/gdb/gdbthread.h b/gdb/gdbthread.h
index 1ed98a2..937bd55 100644
--- a/gdb/gdbthread.h
+++ b/gdb/gdbthread.h
@@ -354,6 +354,14 @@ extern struct thread_info *iterate_over_threads (thread_callback_func, void *);
for (T = thread_list; T; T = T->next) \
if ((T)->state != THREAD_EXITED)
+/* Like ALL_NON_EXITED_THREADS, but allows deleting the currently
+ iterated thread. */
+#define ALL_NON_EXITED_THREADS_SAFE(T, TMP) \
+ for ((T) = thread_list; \
+ (T) != NULL ? ((TMP) = (T)->next, 1): 0; \
+ (T) = (TMP)) \
+ if ((T)->state != THREAD_EXITED)
+
extern int thread_count (void);
/* Switch from one thread to another. */