Challenge: The invisible concurrency bug-Answer

added by DotNetKicks
4/3/2018 1:35:29 PM

2 Kicks, 235 Views

Except that in this case, the lambda is capturing the engine parameter that is passed to the function. The engine is single threaded, and must not be used concurrently. The problem is that the code already handles this situation, and the current engine instance is passed to the lamda, where it is never used.