The first thread locks the mutex and appends data to the queue, while the other threads wait for their turn.
第一个线程锁住互斥并把数据添加到队列中,而其他线程等待轮到它们操作。
The purpose of the sleep is to allow the garbage collector to finish up after it has released the other threads.
休眠的目的在于给垃圾回收器充分的时间,在释放其他线程之后完成工作。
If main finishes before the threads it has created and exits with pthread_exit , the other threads continue to execute.
如果main在它创建的线程之前完成,并使用pthread_exit退出,那么其他线程将继续执行。
Different threads can successively call the function and modify the data without informing the other threads that are using the data.
不同的线程可能会先后调用那个函数,并且修改那些数据时不会通知其他正在使用此数据的线程。
Different threads can successively call the function and modify the data without informing the other threads that are using the data.
不同的线程可能会先后调用那个函数,并且修改那些数据时不会通知其他正在使用此数据的线程。
应用推荐