troydhanson / uthash

C macros for hash tables and more

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

What's the correct way to delete all elements by HASH_ITER thead-safe ?

GF-Huang opened this issue · comments

AcquireLock();

HASH_ITER(...) {
    HASH_DEL(...)
}

ReleaseLock();

or

HASH_ITER(...) {
    AcquireLock();

    HASH_DEL(...)

    ReleaseLock();
}