Thread: Add some macros to simplify the conditional code in particular the one related to mmove semantics+ fix some minor regression issues