jonhoo / flurry

A port of Java's ConcurrentHashMap to Rust

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unsoundness in `HashMap::clear`

ibraheemdev opened this issue · comments

HashMap::clear does not have K\V: Send + Sync bounds, even though it calls defer_destroy on nodes and values, which might call the destructors on another thread. Unless I am missing something, this is unsound and could cause undefined behavior.

Ah, yes, you are entirely right! Good catch. Would you mind submitting a PR with a fix?

Fixed as a side-affect of #102, K/V: 'static is no longer required.