create scheduler event lock in scheduler_task, not in enqueue events
Merge pull request #666 from pdvyas/scheduler-fix

create scheduler event lock in scheduler_task, not in enqueue events