Cpp Note5: 多线程
Creation and Identification
Lifecycle
Pass Arguments to Threads
int main() { auto callback = [](int& a){ a = 2; cout << "called" << endl; }; int num = 10; thread t = thread(bind(callback, ref(num))); t.join(); cout << num << endl; return 0; }called 2
Condition Variables
std::future, std::promise and Return Value of threads
std::async()
Last updated
