Patch Set 2:

I see the inlined comments now on the first patch now, Jens, thanks.

I think I may have some other concerns about this whole locking thing but let's get this out of the way first before we do more polishing. :)