support -S in threads/main.cc