Polling task queue, changed scenario1

Whenever resources are released, check the first task in the workQueue
and try to allocate resources for it. If the resources are not
available, do nothing.