ported threads test from glfw