Added Mac implementation of barrier