Changeset 14c9aa6 in mainline for kernel/generic/include/adt/cht.h
- Timestamp:
- 2012-07-27T13:40:19Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 0949b7a
- Parents:
- 4ec9ea41
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/include/adt/cht.h
r4ec9ea41 r14c9aa6 40 40 #include <synch/rcu.h> 41 41 #include <macros.h> 42 #include <synch/workqueue.h> 42 43 43 44 typedef uintptr_t cht_ptr_t; … … 53 54 /** Set of operations for a concurrent hash table. */ 54 55 typedef struct cht_ops { 55 size_t (*hash)(c ht_link_t *node);56 size_t (*hash)(const cht_link_t *item); 56 57 size_t (*key_hash)(void *key); 57 58 bool (*equal)(const cht_link_t *item1, const cht_link_t *item2); … … 70 71 cht_ops_t *op; 71 72 73 size_t min_order; 72 74 cht_buckets_t *b; 73 75 cht_buckets_t *new_b; 76 77 work_t resize_work; 78 atomic_t resize_reqs; 74 79 75 atomic_t resize_reqs;76 80 atomic_t item_cnt; 77 81 } cht_t; … … 84 88 #define cht_read_unlock() rcu_read_unlock() 85 89 86 extern void cht_create(cht_t *h, size_t init_size, cht_ops_t *op);90 extern bool cht_create(cht_t *h, size_t init_size, size_t min_size, cht_ops_t *op); 87 91 extern void cht_destroy(cht_t *h); 88 92 89 93 extern cht_link_t *cht_find(cht_t *h, void *key); 90 94 extern cht_link_t *cht_find_lazy(cht_t *h, void *key); 95 extern cht_link_t *cht_find_next(cht_t *h, const cht_link_t *item); 96 extern cht_link_t *cht_find_next_lazy(cht_t *h, const cht_link_t *item); 97 91 98 extern void cht_insert(cht_t *h, cht_link_t *item); 92 99 extern bool cht_insert_unique(cht_t *h, cht_link_t *item);
Note:
See TracChangeset
for help on using the changeset viewer.