Closed snakex64 closed 2 weeks ago
@snakex64 @dluc Surely I'm missing something, but I'm wondering how this change (an if
instrctuion moved inside a try... catch
block):
Will modify the behavior?
@snakex64 @dluc Surely I'm missing something, but I'm wondering how this change (an
if
instrctuion moved inside atry... catch
block):Will modify the behavior?
it's about the code executed in finally
Oh... I see, in this way the return
causes the semaphore to be released. Thank you for the clarification!
Motivation and Context (Why the change? What's the scenario?)
A simple bugfix for SQLServerMemory. The semaphore wasn't released when "is ready" changes from "false" to "true" while the code was waiting for the semaphore. Meaning if specifically 3 or more tasks run into that code at the same time, the third task as well as all others are gonna be stuck in a deadlock waiting for the semaphore. This only happens during the first initialization, since subsequent calls will leave before waiting for the semaphore.