Incorporated threadlock into @schedule_lock of TimeScheduler