diff options
| author | yangwei <[email protected]> | 2024-08-28 14:52:26 +0800 |
|---|---|---|
| committer | yangwei <[email protected]> | 2024-08-28 14:52:26 +0800 |
| commit | 16b18624ab32aa2b7e9691763b822bf408a43074 (patch) | |
| tree | 0c5da95935f65c379ac672ed49f6e42f1382b4ba /infra/session_manager/session_pool.h | |
| parent | aa1bfb383fc542c6375c932dcb8cebfee9fb5abc (diff) | |
🦄 refactor(directory structure): restructure and rename src to infra
Diffstat (limited to 'infra/session_manager/session_pool.h')
| -rw-r--r-- | infra/session_manager/session_pool.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/infra/session_manager/session_pool.h b/infra/session_manager/session_pool.h new file mode 100644 index 0000000..9f607b9 --- /dev/null +++ b/infra/session_manager/session_pool.h @@ -0,0 +1,23 @@ +#pragma once + +#ifdef __cplusplus +extern "C" +{ +#endif + +#include <stdint.h> + +struct session_pool; +struct session_pool *session_pool_new(uint64_t capacity); +void session_pool_free(struct session_pool *pool); + +struct session *session_pool_pop(struct session_pool *pool); +void session_pool_push(struct session_pool *pool, struct session *sess); +const struct session *session_pool_get0(const struct session_pool *pool, uint64_t idx); + +uint64_t session_pool_available_num(const struct session_pool *pool); +uint64_t session_pool_capacity_size(const struct session_pool *pool); + +#ifdef __cplusplus +} +#endif |
