Update main.cpp

fix threading on linux (part 2)