code builds using clang: shkiper@server:~/C++/Thread$ clang++ thread.cpp -o thread -pthread -std=c++11 shkiper@server:~/C++/Thread$ ./thread 1307674368000 355687428096000 shkiper@server:~/C++/Thread$ so, problem is in g++
code builds using clang: server: ~/C++/Thread$ clang++ thread.cpp -o thread -pthread -std=c++11 server: ~/C++/Thread$ ./thread server: ~/C++/Thread$
shkiper@
shkiper@
1307674368000
355687428096000
shkiper@
so, problem is in g++