Created
January 20, 2016 12:52
-
-
Save rettichschnidi/96b7e7425e6b1a28f5a9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <future> | |
#include <thread> | |
int main() { | |
std::promise<void> promise; | |
std::future<void> future = promise.get_future(); | |
std::thread work_thread([&promise] { promise.set_value(); }); | |
future.wait(); | |
work_thread.join(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment