Granular locking