You should protect ~OpContext() somehow since correctness now depends on it only being used in conjunction with the lock cleanup stuff. Or just do the unlock stuff via the constructor, now that I think about it.