blob: 2aed03efb4748de4442c669bc4a9c2cbda385187 [file] [log] [blame]
rjw1f884582022-01-06 17:20:42 +08001#ifndef __SEQ_QUEUE__H_
2#define __SEQ_QUEUE__H_
3
4#include "syn_primitive.h"
5
6
7#ifndef in
8#define in
9#define out
10#endif
11
12#define EXPAND_BLOCK_NUM 100
13
14typedef struct
15{
16 BOOL expandabilit;
17 unsigned int expand_blocks;
18
19 unsigned int block_size;
20 unsigned int total_block;
21
22 unsigned int current_block;
23 unsigned int tail_block;
24 unsigned int used_block;
25
26 void *block_buffer;
27
28 //mutex_handle task_queue_lock;
29 sem_handle task_queue_lock;
30
31}seq_queue_t;
32
33
34seq_queue_t *create_seq_queue(in unsigned int block_size, in unsigned int total_block, in BOOL expand);
35void destroy_seq_queue(in seq_queue_t *queue);
36BOOL en_seq_queue(in seq_queue_t *queue, in void *data);
37BOOL de_seq_queue(in seq_queue_t *queue, out void *data);
38unsigned int get_count_seq_queue(in seq_queue_t *queue);
39unsigned int get_total_seq_queue(in seq_queue_t *queue);
40
41
42#endif //__SEQ_QUEUE__H_
43