Skip to content

Instantly share code, notes, and snippets.

@rettichschnidi
Created January 20, 2016 12:52
Show Gist options
  • Save rettichschnidi/96b7e7425e6b1a28f5a9 to your computer and use it in GitHub Desktop.
Save rettichschnidi/96b7e7425e6b1a28f5a9 to your computer and use it in GitHub Desktop.
#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