xref: /netbsd-src/external/gpl3/gdb.old/dist/gdb/run-on-main-thread.h (revision 6881a4007f077b54e5f51159c52b9b25f57deb0d)
17d62b00eSchristos /* Run a function on the main thread
2*6881a400Schristos    Copyright (C) 2019-2023 Free Software Foundation, Inc.
37d62b00eSchristos 
47d62b00eSchristos    This file is part of GDB.
57d62b00eSchristos 
67d62b00eSchristos    This program is free software; you can redistribute it and/or modify
77d62b00eSchristos    it under the terms of the GNU General Public License as published by
87d62b00eSchristos    the Free Software Foundation; either version 3 of the License, or
97d62b00eSchristos    (at your option) any later version.
107d62b00eSchristos 
117d62b00eSchristos    This program is distributed in the hope that it will be useful,
127d62b00eSchristos    but WITHOUT ANY WARRANTY; without even the implied warranty of
137d62b00eSchristos    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
147d62b00eSchristos    GNU General Public License for more details.
157d62b00eSchristos 
167d62b00eSchristos    You should have received a copy of the GNU General Public License
177d62b00eSchristos    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
187d62b00eSchristos 
197d62b00eSchristos #ifndef GDB_RUN_ON_MAIN_THREAD_H
207d62b00eSchristos #define GDB_RUN_ON_MAIN_THREAD_H
217d62b00eSchristos 
227d62b00eSchristos #include <functional>
237d62b00eSchristos 
247d62b00eSchristos /* Send a runnable to the main thread.  */
257d62b00eSchristos 
267d62b00eSchristos extern void run_on_main_thread (std::function<void ()> &&);
277d62b00eSchristos 
28*6881a400Schristos /* Return true on the main thread.  */
29*6881a400Schristos 
30*6881a400Schristos extern bool is_main_thread ();
31*6881a400Schristos 
327d62b00eSchristos #endif /* GDB_RUN_ON_MAIN_THREAD_H */
33