also use global curthread