| 261 | } |
| 262 | |
| 263 | void cleanup_background_threads() FL_NOEXCEPT { |
| 264 | auto& bg = ICoroutineRuntime::instance(); |
| 265 | bg.requestShutdown(); |
| 266 | auto& reg = BackgroundThreadRegistry::instance(); |
| 267 | fl::unique_lock<fl::mutex> lock(reg.mtx) FL_NOEXCEPT; |
| 268 | for (auto& t : reg.threads) { |
| 269 | if (t.joinable()) t.join(); |
| 270 | } |
| 271 | reg.threads.clear(); |
| 272 | bg.resetShutdown(); |
| 273 | } |
| 274 | |
| 275 | bool is_shutdown_requested() FL_NOEXCEPT { |
| 276 | return ICoroutineRuntime::instance().isShutdownRequested(); |
no test coverage detected