• 2024-08-19两线程读写数组
    #include<stdio.h>#include<stdlib.h>#include<pthread.h>#include<unistd.h>#defineARRAY_SIZE10intshared_array[ARRAY_SIZE];pthread_mutex_tmutex;void*write_data(void*arg){intthread_id=*(int*)arg;