[boost] Problems with conditions in boost::thread