Threading helper macro