Rename lock to barrier and document.