I want to get the overall cook state's information like the new PDG toolbar UI. On how many nodes or work items have been cooked, and how many been waiting for cooking. Now I use code like this:
And I want to get reported (print some logs) for every work item when it get cooked, so I put the code to the WorkItemStateChange EventHandler. It works but sometimes the work item hanging on cooking state and never gets cooked. So is there any convenient way to do such thing? Thanks.
Unless you're seeing wrong information in the toolbar or in the TOP nodes, it is safe to assume the events are correct, as both relies on them. You might be running into data race issues, try using a lock around your code.