What I'm doing for now is simply using a short "sleep" command when attempting to lock fails (implemented as suggested with a boolean variable); it appears to me that everyone involved can afford to wait a bit.
Do you find that that works? If it's a problem of reentrancy, it doesn't seem that it would.
