There are some sample code here in the forum, for example in https://communities.vmware.com/thread/418796
Basically, LockingSystem.lock(...,...) and LockingSystem.lockandWait(...,...) creates a record in the vRO database to mark some object (the first parameter in these functions) as 'locked', and respectively LockingSystem.unlock(...,...) is used to 'unlock' the object.
Note that the object is not indeed locked (which is not possible in general case), it is just marked as locked. So it is up to your code to respect the locked state of the object by trying to acquire a lock to it before any operation with the object that could potentially modify/mutate it.
Also, it is essential to ensure that all objects your code lock will be unlocked after you finish with your modifications.
Got it.Thank you Ilian Iliev sir.