runtime: added hooks for runtime thread changes