Skip to content

Instantly share code, notes, and snippets.

@nlharri
Created November 13, 2018 20:36
Show Gist options
  • Save nlharri/8ab4332015837032c232d5a6f2f9f773 to your computer and use it in GitHub Desktop.
Save nlharri/8ab4332015837032c232d5a6f2f9f773 to your computer and use it in GitHub Desktop.
WifiScannerLinux - registration of Wi-Fi scanner thread
// Create a std::promise object
std::promise<void> exitSignal;
//Fetch std::future object associated with promise
std::future<void> futureObj = exitSignal.get_future();
// Starting Thread & move the future object in lambda function by reference
std::thread th(&wifiScannerThread, std::move(futureObj), wifiIfName, wifiAPCollection);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment