Contention Management by Port Drivers

Port drivers also do contention handling. By default, port drivers do not allow a caller to open an open port. However, the owner of a port can send ioctls to the port driver to "unlock" access to the port. In this case, if another caller calls to open a port, the port driver will notify the original owner and give the port to the new caller. When the port is closed, the original owner will be notified again that the port has now been released. The port drivers keep a stack of such owners; all of them are notified one by one when the port is released. If one of the owners reopens the port during the callback, the earlier owners are not notified.