compiles and runs, bit segfault at thread creation.