Only use threading when threading is enabled