From 0981fe1017a8111aa6544ff52bcbbc80eec6b3c0 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Wed, 30 Mar 2022 20:19:54 -0600 Subject: Allow thread-pool.h to work without threads thread-pool.h requires CXX_STD_THREAD in order to even be included. However, there's no deep reason for this, and during review we found that one patch in the new DWARF indexer series unconditionally requires the thread pool. Because the thread pool already allows a task to be run in the calling thread (for example if it is configured to have no threads in the pool), it seemed straightforward to make this code ok to use when host threads aren't available at all. This patch implements this idea. I built it on a thread-less host (mingw, before my recent configure patch) and verified that the result builds. After the thread-pool change, parallel-for.h no longer needs any CXX_STD_THREAD checks at all, so this patch removes these as well. --- gdb/maint.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'gdb') diff --git a/gdb/maint.c b/gdb/maint.c index 3f3dad5..60e183e 100644 --- a/gdb/maint.c +++ b/gdb/maint.c @@ -41,16 +41,13 @@ #include "maint.h" #include "gdbsupport/selftest.h" #include "inferior.h" +#include "gdbsupport/thread-pool.h" #include "cli/cli-decode.h" #include "cli/cli-utils.h" #include "cli/cli-setshow.h" #include "cli/cli-cmds.h" -#if CXX_STD_THREAD -#include "gdbsupport/thread-pool.h" -#endif - static void maintenance_do_deprecate (const char *, int); #ifndef _WIN32 -- cgit v1.1