Added barrier synchronisation.