Community
Participate
Working Groups
Unlocking all locks for a given context, i.e. calling RWOLockManager.unlock(CONTEXT context), causes ConcurrendModEx, due to the removal of lockStates while the set of lockStates for a given context is being iterated over. (The actual removal happens in #removeLockFromContext.) No test case was ever written for this scenario. Not sure if the old RWLockManager did it right. Doesn't matter now, will provide a fix + testcase for the RWOLockManager momentarily.
Created attachment 200519 [details] Patch v1
Created attachment 200521 [details] Patch v2 v2 of the patch renames the maps and a method involved with updating the contextToLockStates map. I know you (Eike) renamed the method before, but I really believe the name 'removeLockFromContext' is deceiving. First, what's being removed is a LockState object, which is a combination of locks, not a single lock. And second, it's not being removed from a context; rather, it's being removed from the set of all lockStates that a given context is involved in. I added JavaDocs to the method, to this effect. (Functionally patch v2 is the same as v1.)
PS. I recommend looking at patch v1 first, because it shows how minimal the fix is.
Created attachment 200524 [details] Patch v3 (left-over tests removed)
Committed revision 8839.
Closing.