Thread: merge from trunk to fix #6843,#6966.

svn path=/branches/release/boost/thread/; revision=83938