- 博客(4)
- 收藏
- 关注
原创 c 语言进程
文章目录进程锁介绍#include <stdio.h>#include <pthread.h>#include <unistd.h>#define M 3int tickets = 20;pthread_mutex_t lock; //互斥锁// 线程函数,用于售票void *fun(void *args) { while (1) { pthread_mutex_lock(&lock); // 获取互斥锁
2024-05-04 15:54:28
296
1
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅