merged controlthread.h