I have 2 thread to create thread1 and thread2. When creating threads with:
pthread_create(&thread1, NULL, &function_th1, NULL);
pthread_create(&thread2, NULL, &function_th2, NULL);
The thread2 is launched before the thread1 and I’m looking for a solution to start thread1 before thread2.
Not looking for this solution:
pthread_create(&thread2, NULL, &function_th2, NULL);
pthread_create(&thread1, NULL, &function_th1, NULL);
here after the solution I suggest