This introduces a facility to EVENTHANDLER(9) for explicitly defining a reference to an event handler list. This is useful since previously all invokers of events had to do a locked traversal of the global list of event handler lists in order to find the appropriate event handler list. By keeping a pointer to the appropriate list an invoker can avoid this traversal completely. The pointer is initialized with SYSINIT(9) during the eventhandler stage. Users registering interest in events do not need to know if the event is backed by such a list, since the list is added to the global list of lists as normal. As with lists that are not pre-defined it is safe to register for the events before the list has been created.
This converts the process_* and thread_* events to using the new facility, as these are events whose traversals end up showing up significantly in ports build workflows. It may be advantageous to convert other events to using the new facility as well.