I think you're right about not having to test for the null. If you don't
test for null, B will think he failed, will stall and try again (though he
does not have to). So it works...ok...good.
Chandru
"Mike Preece" <michael (AT) preece (DOT) net> wrote
Quote:
Maybe I could express this better...
The problem as stated was that both/multiple threads could see the lock
as available and both attempt to take ownership, with the first attempt
being overwritten/overridden by subsequent attempts. By *appending* to
a lock *array*, rather than a scalar value, we remove the possibility
of anything being overwritten. Only the first element in the array has
any significance. Any clearer?
Mike. |