MCPcopy Create free account
hub / github.com/OpenSIPS/opensips / hash_init_locks

Function hash_init_locks

lib/hash.c:25–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23#include "../mem/rpm_mem.h"
24
25int hash_init_locks(gen_hash_t *h)
26{
27 unsigned int n;
28 gen_lock_set_t *locks = NULL;
29
30 for (n = h->size; n >= 1 && !locks; n/=2) {
31 locks = lock_set_alloc(n);
32 if (locks && lock_set_init(locks))
33 break;
34 }
35
36 if (!locks) {
37 LM_ERR("could not allocate hash locks\n");
38 return -1;
39 }
40 h->locks = locks;
41 h->locks_no = n;
42 return 0;
43}
44
45gen_hash_t *hash_init_flags(unsigned int size, unsigned int flags)
46{

Callers 2

mod_initFunction · 0.85
hash_init_flagsFunction · 0.85

Calls 2

lock_set_allocFunction · 0.85
lock_set_initFunction · 0.85

Tested by

no test coverage detected