This code here says the static variables "should become 'thread_local globals' ". Is there anything preventing just putting _Thread_local in the declaration?
The current version leads to sampling from the hypergeometric distribution (rhyper) being broken when used in a threaded context. I mentioned this previously at JuliaStats/Distributions.jl#1829.