« Previous | Next » 

Revision 4d686df8

ID4d686df85cf052fe3b31c97bb7f61de9f1166f5d
Parent 6536dfa1
Child 21a6c826

Added by Guido Trotter about 16 years ago

Increase SharedLock fairness

Previously if a shared thread was notified, together with the rest, and was not
fast enough in waking up and acquiring the lock, another one could release it,
decide there were no more sharers, and let an exclusive one in instead. With
this patch we make sure all the shared holders which were waiting have passed,
before declaring it's time to make an exclusive one pass.

This also allows us to reintroduce a slight variation of the assertion removed
in r665, which makes our code safer.

Reviewed-by: imsnah

Files

  • added
  • modified
  • copied
  • renamed
  • deleted

View differences