added threading macros