-
Notifications
You must be signed in to change notification settings - Fork 385
semaphore.h
mutouyun edited this page Dec 9, 2025
·
1 revision
#include "libipc/semaphore.h"
定义进程间信号量类ipc::sync::semaphore。
-
ipc::sync::semaphore- 进程间信号量
#include "libipc/semaphore.h"
ipc::sync::semaphore sem("my_sem", 5); // 初始计数为5
sem.wait(); // P操作
// 使用资源
sem.post(); // V操作-
ipc::sync::semaphore- Semaphore类详细文档 - namespace ipc::sync - sync命名空间