[libcxx-commits] [libcxx] [libc++] Fix std::future not waiting until the thread is finished to clean up (PR #130145)

kadir çetinkaya via libcxx-commits libcxx-commits at lists.llvm.org
Fri Mar 7 01:58:43 PST 2025


================
@@ -1831,7 +1829,12 @@ template <class _Rp, class _Fp>
 _LIBCPP_HIDE_FROM_ABI future<_Rp> __make_async_assoc_state(_Fp&& __f) {
   unique_ptr<__async_assoc_state<_Rp, _Fp>, __release_shared_count> __h(
       new __async_assoc_state<_Rp, _Fp>(std::forward<_Fp>(__f)));
-  std::thread(&__async_assoc_state<_Rp, _Fp>::__execute, __h.get()).detach();
+  try {
----------------
kadircet wrote:

what if exceptions are off ?

https://github.com/llvm/llvm-project/pull/130145


More information about the libcxx-commits mailing list