process worklist in loop

Signed-off-by: Andrey Rybalchenko <rybal@microsoft.com>