barrier implementation
barrier threshold
some spin fixes