Added thread-safe macroses according to perlguts