Change locking to a "barrier" method