Lines Matching +full:other +full:- +full:key

1 /*-
14 * documentation and/or other materials provided with the distribution.
34 #include "un-namespace.h"
40 void *key; member
47 #define PSHARED_KEY_HASH(key) (((unsigned long)(key) >> 8) % HASH_SIZE) argument
48 /* XXXKIB: lock could be split to per-hash chain, if appears contested */
70 curthread->locklevel++; in pshared_rlock()
78 curthread->locklevel++; in pshared_wlock()
87 curthread->locklevel--; in pshared_unlock()
93 * pthread_lock_destroy(). Other processes still have the hash and
94 * mapped off-page.
99 * too time-consuming.
113 h->val, NULL); in pshared_gc()
117 munmap(h->val, page_size); in pshared_gc()
125 pshared_lookup(void *key) in pshared_lookup() argument
130 hd = &pshared_hash[PSHARED_KEY_HASH(key)]; in pshared_lookup()
132 if (h->key == key) in pshared_lookup()
133 return (h->val); in pshared_lookup()
139 pshared_insert(void *key, void **val) in pshared_insert() argument
144 hd = &pshared_hash[PSHARED_KEY_HASH(key)]; in pshared_insert()
147 * When the key already exists in the hash, we should in pshared_insert()
149 * val, and the other val should be unmapped to avoid in pshared_insert()
158 * might operate on an unmapped off-page object. in pshared_insert()
160 * There is still an issue: if hashed key was unmapped in pshared_insert()
161 * and then other page is mapped at the same key in pshared_insert()
167 if (h->key == key) { in pshared_insert()
168 if (h->val != *val) { in pshared_insert()
170 *val = h->val; in pshared_insert()
179 h->key = key; in pshared_insert()
180 h->val = *val; in pshared_insert()
186 pshared_remove(void *key) in pshared_remove() argument
192 hd = &pshared_hash[PSHARED_KEY_HASH(key)]; in pshared_remove()
194 if (h->key == key) { in pshared_remove()
196 val = h->val; in pshared_remove()
205 pshared_clean(void *key, void *val) in pshared_clean() argument
210 _umtx_op(NULL, UMTX_OP_SHM, UMTX_SHM_DESTROY, key, NULL); in pshared_clean()
214 pshared_destroy(struct pthread *curthread, void *key) in pshared_destroy() argument
219 val = pshared_remove(key); in pshared_destroy()
221 pshared_clean(key, val); in pshared_destroy()
225 __thr_pshared_offpage(void *key, int doalloc) in __thr_pshared_offpage() argument
233 pshared_destroy(curthread, key); in __thr_pshared_offpage()
237 res = pshared_lookup(key); in __thr_pshared_offpage()
243 UMTX_SHM_LOOKUP, key, NULL); in __thr_pshared_offpage()
244 if (fd == -1) in __thr_pshared_offpage()
251 ins_done = pshared_insert(key, &res); in __thr_pshared_offpage()
254 pshared_clean(key, res); in __thr_pshared_offpage()
261 __thr_pshared_destroy(void *key) in __thr_pshared_destroy() argument
266 pshared_destroy(curthread, key); in __thr_pshared_destroy()