public void RunTaskSync(ScheduledTask task) { if (task.IsRunning) { return; } lock (lckSyncRun) { task.IsRunning = true; task.RunTask(); task.IsRunning = false; } }