Skip to content

Instantly share code, notes, and snippets.

@redforce01
Created March 23, 2017 01:16
Show Gist options
  • Save redforce01/7da71959784beeda46d0c07276c6258d to your computer and use it in GitHub Desktop.
Save redforce01/7da71959784beeda46d0c07276c6258d to your computer and use it in GitHub Desktop.
for my blog gist - thread code #4
class ThreadPara
{
public:
void func()
{
for(int i = 0; i < 5; i++)
std::cout << "ThreadPara Num : " << i << std::endl;
}
};
ThreadPara thread_para;
std::thread myThread(&ThreadPara::func, &thread_para);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment