implement barrier into adportable since boost::barrier conflict with mac c++11 environment