摘要:
void function(); void function1(); std::thread t1( function ); //启动一个新线程t1与function关联 std::thread t2 = std::move(t1); //将t1限行的转移给t2 t1 = std::thread( 阅读全文
摘要:
#include <iostream>#include <thread>#include <windows.h> using namespace std;void switch_ab (int &a, int &b) //参数是引用可更改 //void switch_ab (int &a, int 阅读全文
摘要:
#include <iostream>#include <thread>#include <unistd.h>void hello(){ while(1) { std::cout << "hello world" << std::endl; for(int i=0;i<999999999;i++); 阅读全文