[PLAT-2960] Add barrier distance function