Add hooks to track which threads belong to which thread pools