The lock-based barrier is effectively the same pattern as DRB186-barrier2-no.c. The commented lock is not necessary to provide the barrier semantics.