CPPLearning/main.cpp
/**
 Create a thread to add num with mutex
 */
Create a thread to add num with mutex
Create a thread to add num with mutex
void multiThread()
{
    RenderThread *render;
    render = new RenderThread;
    render->createThread();
    while (render->num < 10000) {
        std::cout << "num:" << render->num << std::endl;
    }
    delete render;
}
void multiThread ( ) { RenderThread * render ; render = new RenderThread ; render -> createThread ( ) ; while ( render -> num < 10000 ) { std :: cout << " " << render -> num << std :: endl ; } delete render ; }
Create a thread to add num with mutex
Create a thread to add num with mutex