lock init

writer_lock must be inited before used.

Change-Id: Ib258aa09b3bccc4de6edba0eb75a7eec20f1a61f
Signed-off-by: JingLiuZTE <liu.jing5@zte.com.cn>
(cherry picked from commit 4c9f2a8050)
This commit is contained in:
JingLiuZTE
2017-11-08 15:35:01 +08:00
committed by Florin Coras
parent 5ed8774529
commit ace9fc92ca

View File

@ -35,6 +35,7 @@ void BV (clib_bihash_init)
vec_validate_aligned (h->buckets, nbuckets - 1, CLIB_CACHE_LINE_BYTES);
h->writer_lock = clib_mem_alloc_aligned (CLIB_CACHE_LINE_BYTES,
CLIB_CACHE_LINE_BYTES);
h->writer_lock[0] = 0;
for (i = 0; i < nbuckets; i++)
BV (clib_bihash_reset_cache) (h->buckets + i);