version 1.1
make the thread proc function as member function and add some private functions