Locking additions

Nothing final, just starting to implement lock/release