Improved process locking