Lock threads.