That could work; but I'm a bit worried about deadlocks now that you're locking on multiple objects. And it's also not good for performance to lock for every single property getter.
I took a slightly different approach: https://github.com/dgrunwald/cecil/commits/threadsafe2 This should be safe under the following assumptions: a) The module is accessed for reading only b) Writes are never reordered (not guaranteed in the CLI spec; but the MS .NET memory model has this additional guarantee) c) We do not care about the identity of empty collections d) I didn't forget any lazy-initialized property :) Daniel On 2/22/2011 11:50, Jb Evain wrote: > On Tue, Feb 22, 2011 at 8:48 AM, Jb Evain <[email protected]> wrote: >> Thanks for investigating this Daniel, I'll see about fixing it. > Could you try the threadsafe branch on github? > > Jb
signature.asc
Description: OpenPGP digital signature
