use -lpthread