> Great minds think alike ;-) ... I just committed exactly that protocol.
> I believe it is correct, because AFAICS there are only four possible
> risk cases:
Congrats !
For general culture you might be interested in reading this :
http://en.wikipedia.org/wiki/Software_transactional_memory
http://libcmt.sourceforge.net/