mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-09 12:35:28 +00:00
Whitespace: Automated whitespace fixes (large commit)
Apply the pre-commit hook whitespace fixes to all files in the repo. (Line endings, blank lines at end of file, trailing whitespace)
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
#include <future>
|
||||
#include <thread>
|
||||
#include "unity.h"
|
||||
|
||||
|
||||
#if __GTHREADS && __GTHREADS_CXX0X
|
||||
TEST_CASE("C++ future", "[std::future]")
|
||||
{
|
||||
@@ -10,15 +10,15 @@ TEST_CASE("C++ future", "[std::future]")
|
||||
std::packaged_task<int()> task([]{ return 7; }); // wrap the function
|
||||
std::future<int> f1 = task.get_future(); // get a future
|
||||
std::thread t(std::move(task)); // launch on a thread
|
||||
|
||||
|
||||
// future from an async()
|
||||
std::future<int> f2 = std::async(std::launch::async, []{ return 8; });
|
||||
|
||||
|
||||
// future from a promise
|
||||
std::promise<int> p;
|
||||
std::future<int> f3 = p.get_future();
|
||||
std::thread( [&p]{ p.set_value_at_thread_exit(9); }).detach();
|
||||
|
||||
|
||||
std::cout << "Waiting..." << std::flush;
|
||||
f1.wait();
|
||||
f2.wait();
|
||||
@@ -28,4 +28,3 @@ TEST_CASE("C++ future", "[std::future]")
|
||||
t.join();
|
||||
}
|
||||
#endif
|
||||
|
||||
|
Reference in New Issue
Block a user