enhance ordq

This commit is contained in:
Rongsong Shen 2025-12-17 12:14:52 +08:00
parent e85ce0e5ad
commit 48ab2e60a2
4 changed files with 119 additions and 14 deletions

View file

@ -16,6 +16,7 @@ typedef struct _ordq_item {
typedef int (*ordq_cmp_fn_t)(void*, ordkey_t, ordkey_t);
typedef void (*ordq_data_killer_t)(void*);
typedef int (*ordq_skip_fn_t)(void*, ordq_item_t*);
typedef struct {
mylock_t lock;
@ -30,8 +31,8 @@ typedef struct {
extern int ordq_init(ordq_t*, ordq_data_killer_t, ordq_cmp_fn_t);
extern void ordq_fini(ordq_t* q);
extern int ordq_put(ordq_t*, ordkey_t, void*);
extern ordq_item_t* ordq_get(ordq_t*);
extern ordq_item_t* ordq_peek(ordq_t*);
extern ordq_item_t* ordq_get(ordq_t*, ordq_skip_fn_t);
extern ordq_item_t* ordq_peek(ordq_t*, ordq_skip_fn_t);
extern void ordq_set_ctx(ordq_t*, void*);
#endif