Small tests i share because why not
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

17 řádky
292 B

před 5 roky
  1. #include <thread>
  2. #include <iostream>
  3. volatile int counter=0;
  4. void incr(const int count=200000)
  5. {
  6. for(int i=0;i<count;i++)
  7. counter++;
  8. }
  9. int main()
  10. {
  11. std::thread m(incr,200000);
  12. incr(200000);
  13. std::cout << "Expects 400000, get "<< counter <<std::endl;
  14. return 0;
  15. }