I can not take a critical section

51 views Asked by At

I have a thread stopped taking a critical section. The critical section does not have any thread owning, the only strange thing is that LockCount is -3.

  • LockCount -3
  • RecursionCount 0
  • OwningThread 0
  • LockSemaphore dfc
  • SpinCount 10000

Inside debug info the ContentionCount is 1.

How can I get a lockCount of -3? any idea?

Thank you.

1

There are 1 answers

0
yb303 On

Yes. You released it more times than you acquired it. It's a good idea to use a scoped guard to auto-release it. Then you don't have to worry about multi release.