add task scheduler (sched's schedular does not use multithreading)
use new task scheduler, add lock when printing debug info