Thread routines can be configured in a type-safe manner