rjw | 1f88458 | 2022-01-06 17:20:42 +0800 | [diff] [blame^] | 1 | #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 |
|
| 14 | typedef 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 |
|
| 34 | seq_queue_t *create_seq_queue(in unsigned int block_size, in unsigned int total_block, in BOOL expand);
|
| 35 | void destroy_seq_queue(in seq_queue_t *queue);
|
| 36 | BOOL en_seq_queue(in seq_queue_t *queue, in void *data);
|
| 37 | BOOL de_seq_queue(in seq_queue_t *queue, out void *data);
|
| 38 | unsigned int get_count_seq_queue(in seq_queue_t *queue);
|
| 39 | unsigned int get_total_seq_queue(in seq_queue_t *queue);
|
| 40 |
|
| 41 |
|
| 42 | #endif //__SEQ_QUEUE__H_
|
| 43 |
|