使用共享锁来标记环形缓冲区是否正在被使用
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
#ifndef _MESA_SHM_RING_QUEUE_H_
|
||||
#define _MESA_SHM_RING_QUEUE_H_
|
||||
|
||||
#include <pthread.h>
|
||||
#define MESA_SHM_RING_QUEUE_NUM 128
|
||||
#define MESA_SHM_RING_QUEUE_BLOCK_NUM 8192
|
||||
#define MESA_SHM_RING_QUEUE_BLOCK_BUFLEN 4096
|
||||
@@ -27,7 +29,7 @@ struct MESA_shm_overview{
|
||||
int shmkey;
|
||||
int shmid;
|
||||
int idx;
|
||||
volatile char status;
|
||||
pthread_mutex_t mutex;
|
||||
};
|
||||
|
||||
struct MESA_shm_queue_head{
|
||||
|
||||
Reference in New Issue
Block a user