Suppose the following:
If the lock is active, then the session asks to be notified when the lock is released.`
Which one of the two waiting sessions will get notified that it is now able to acquire locks? Is there a DB setting that controls this?
If the waiters are notified in random order, does that mean that there is a possibility of lock-starving one of the sessions when a lot of them compete for the same lock, or is there a mechanism to address this case?
When you're after a resource (and someone else owns it) you go on a "waiters" queue, and as the name suggests, you get "in line".
If you really want to dig into the weeds, have one session lock a row, then get a couple of others to wait for that row, and then do:
alter session set events = 'immediate trace name enqueues level 3';
to get a trace file showing the various queues floating around.
An excellent resource for this is: Oracle Core, by Jonathan Lewis.