mirror of
https://github.com/upa/mscp.git
synced 2026-02-15 01:34:44 +08:00
change path_list to path_pool
This commit is contained in:
12
src/pool.h
12
src/pool.h
@@ -21,9 +21,21 @@ struct pool_struct {
|
||||
|
||||
typedef struct pool_struct pool;
|
||||
|
||||
/* allocate a new pool */
|
||||
pool *pool_new(void);
|
||||
|
||||
/* func type applied to each item in a pool*/
|
||||
typedef void (*pool_map_f)(void *v);
|
||||
|
||||
/* apply f, which free an item, to all items and set num to 0 */
|
||||
void pool_zeroize(pool *p, pool_map_f f);
|
||||
|
||||
/* free pool->array and pool */
|
||||
void pool_free(pool *p);
|
||||
|
||||
/* free pool->array and pool after applying f to all items in p->array */
|
||||
void pool_destroy(pool *p, pool_map_f f);
|
||||
|
||||
#define pool_lock(p) LOCK_ACQUIRE(&(p->lock))
|
||||
#define pool_unlock(p) LOCK_RELEASE()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user