C++11 之前,C++ 语言没有对并发编程提供语言级别的支持。如果需要使用线程,windows系统需要使用CreateThread函数创建线程,而linux需要使用pthread库使用线程。C++11 中增加了线程以及线程相关的类,语言级别上实现了跨平台使用,增加了多线程程序的可移植性。
c++11添加的线程类std::thread
Member types
id Thread id (public member type)
native_handle_type Native handle type (public member type)
Member functions
(constructor) Construct thread (public member function)
(destru