use static member function in class for thread function