Adding locking/unlocking for separate blocks.

Still doesn't sort the blocks based on their runtime ids.