wip: rebasing @tknopp's threading branch

@tknopp – what's the reason to make this non-static?