This is intended to prevent crashes when unregister_port() modifies the contents of these two members at the same time that something else is iterating over them.
This is intended to prevent crashes when unregister_port() modifies the contents of these two members at the same time that something else is iterating over them.