Generalize painter thread