Small tests i share because why not
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

18 lines
292 B

#include <thread>
#include <iostream>
volatile int counter=0;
void incr(const int count=200000)
{
for(int i=0;i<count;i++)
counter++;
}
int main()
{
std::thread m(incr,200000);
incr(200000);
std::cout << "Expects 400000, get "<< counter <<std::endl;
return 0;
}