Add allow/end thread macros