Open llvmbot opened 8 years ago
To add more info: the bug seems to be fixed in Apple clang 7.3. The program runs indefinitely w/o deadlock as expected.
I didn't answer your question. Yes, it's related to that thread.
The only reason that the above program is "broken" ATM is that wording in the standard doesn't forbid set_value
to do something additional after the atomic update and signaling of the shared state. I believe it is reasonable to expect that the use-case above works, especially in C++11 where you cannot move promise into a lambda.
Therefore I'm going to file a defect report to the committee.
Just checking - is this : https://www.reddit.com/r/cpp/comments/52j3fk/weird_problem_with_stdpromise_and_boost_asio/ ?
Please either reproduce with mainline clang or report the problem with Apple-shipped tools to Apple bugtracker.
The only reason that the above program is "broken" ATM is that wording in the standard doesn't forbid set_value to do something additional after the atomic update and signaling of the shared state. I believe it is reasonable to expect that the use-case above works, especially in C++11 where you cannot move promise into a lambda.
Therefore I'm going to file a defect report to the committee.
This is at least related to https://cplusplus.github.io/LWG/issue2530 ; I wrote a PR https://cplusplus.github.io/LWG/lwg-active.html#2532
Extended Description
The bug happens with "Apple LLVM 7.0.0" (clang 7) on OSX 10.11.1 (El Capitan) with XCode 7.0.1. The program below will write out a series of numbers and after a short while hang, whereas it shouldn't. It runs flawlessly on Linux.