使用进程间共享的信号量,标记消费者进程是否正在运行

This commit is contained in:
guo_peixu
2022-06-28 18:42:05 +08:00
parent c059e7479e
commit dab9b5c03d
5 changed files with 95 additions and 4 deletions

View File

@@ -16,6 +16,9 @@
#define MESA_SHM_RING_QUEUE_HALF_IDLE 2
#define MESA_SHM_RING_QUEUE_USED 3
#define MESA_SEM_KEY 35719
struct MESA_shm_overview *MESA_shm_alloc_overview();
struct MESA_shm_queue_head *MESA_shm_get_ring_queue();
void MESA_shm_init_mutex();
@@ -25,6 +28,10 @@ int MESA_shm_copy_buf_to_ring_queue(char *buf, int buflen, struct MESA_shm_queue
int MESA_shm_ring_queue_is_empty(struct MESA_shm_queue_head *head);
int MESA_shm_ring_queue_is_full(struct MESA_shm_queue_head *head);
void MESA_shm_ring_queue_set_empty(struct MESA_shm_queue_head *head);
int MESA_shm_alloc_sem();
int MESA_shm_consumer_is_running();