Make threading support optional