linux中同步例子(semaphore使用)
#include #include #include #include MODULE_LICENSE("GPL"); int num[2][5]={ {0,2,4,6,8}, {1,3,5,7,9} }; struct semaphore first_sem; struct semaphore second_sem; int thread_fist(void *); int thread_second(void *); int thread_fist(void *p) { int i; int *num=(
复制链接