Fixed a weird issue with boost thread