multithread launching order

前端 未结 4 2001
庸人自扰
庸人自扰 2021-01-15 10:00

I have 4 threads to create thread1, thread2, thread3 and thread4:

pthread_create(thread1,NULL,thread_func1,NULL);
pthread_create(thread2,NULL,thread_func2,NU         


        
4条回答
  •  深忆病人
    2021-01-15 10:38

    Move 'pthread_create(thread2,NULL,thread_func2,NULL);' into thread_func1()
    Move 'pthread_create(thread3,NULL,thread_func2,NULL);' into thread_func2()
    Move 'pthread_create(thread4,NULL,thread_func2,NULL);' into thread_func3()
    

    This is VERY close to the other question posted recently and just as err.. 'strange'

提交回复
热议问题