template for mem/syncbarrier