Add initial implementation of barrier