Adding barrier to ranksort