Add file thread2.cpp.
This file is used to practice how to protect the shared data in C++.