Thread affinity fix