lockwait class, and thread_slinger now uses it