Open gabrbedd opened 1 year ago
Could you please try 17 Release Candidate or main
branch? https://godbolt.org should be helpful.
I could reproduce on Ubuntu 22.04.3 LTS with clang-17 and libc++-17 from apt.llvm.org/jammy . I hope that's recent enough.
$ /usr/lib/llvm-17/bin/clang++ --stdlib=libc++ -v -o main main.cpp
$ /usr/lib/llvm-17/bin/clang++ --version
Ubuntu clang version 17.0.0 (++20230821083344+4ec6595d6e5b-1~exp1~20230821083505.27)
Target: aarch64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/lib/llvm-17/bin
/usr/share/doc/clang-17/changelog.Debian.gz:
llvm-toolchain-17 (1:17.0.0~++20230821083344+4ec6595d6e5b-1~exp1~20230821083505.27) experimental; urgency=medium
[ Sylvestre Ledru ]
* jammy New snapshot release
[ jenkins-debian-glue Autobuilder ]
* SNAPSHOT autobuild for unreleased
1:17.0.0~++20230821083344+4ec6595d6e5b-1~exp1 via jenkins-debian-
glue.
-- jenkins-debian-glue Autobuilder <jenkins@deb-gknlj4.europe-west1-b.c.secret-envoy-319113.internal> Mon, 21 Aug 2023 08:35:05 +0000
readlink -f /lib/aarch64-linux-gnu/libc++.so.1
/usr/lib/llvm-17/lib/libc++.so.1.0
/usr/share/doc/libc++-17-dev/changelog.Debian.gz:
llvm-toolchain-17 (1:17.0.0~++20230821083344+4ec6595d6e5b-1~exp1~20230821083505.27) experimental; urgency=medium
[ Sylvestre Ledru ]
* jammy New snapshot release
[ jenkins-debian-glue Autobuilder ]
* SNAPSHOT autobuild for unreleased
1:17.0.0~++20230821083344+4ec6595d6e5b-1~exp1 via jenkins-debian-
glue.
-- jenkins-debian-glue Autobuilder <jenkins@deb-gknlj4.europe-west1-b.c.secret-envoy-319113.internal> Mon, 21 Aug 2023 08:35:05 +0000
While using
std::async(std::launch::async, )
, the returned future will become unblocked while the remote thread is still accessing shared resources. However, it should "block until the associated thread has completed, as if joined, or else time out."Versions
libc++: 15.00.65.0 (Mac OS, aarch64) and 15.0.7 (Fedora, x86_64) clang++: 14.0.3 (Mac OS, aarch64) and 15.0.7 (Fedora, x86_64)
Example Code
Example Output
Note: I haven't seen it take longer than 1 minute.
Other notes
A work-around for this specific test case is to
std::move()
the shared pointer in the move operators.On assert, there are usually 3 threads running.