Until it returns, the thread that called it is blocked. A thread can call this this method while another is blocked in it, subject to the rules below. This constructor is used by the Bridges object to create a new person. Your Person class may also contain any additional methods that you need. Additional people will break the bridge and they all will fall in the river and drown.
Bridges are one-way.
If two people try to cross the same bridge in opposite directions at the same time, they will fall into the river. If there is more than one person wanting to cross the river, as many bridges as possible should be in use at the same time. Initially, all the bridges are unoccupied. You must prepare two solutions to this problem. In the first solution, there is no fairness guarantees.