Mateusz Guzik 2604eb9e17 mtx: reduce lock accesses
Instead of spuriously re-reading the lock value, read it once.

This change also has a side effect of fixing a performance bug:
on failed _mtx_obtain_lock, it was possible that re-read would find
the lock is unowned, but in this case the primitive would make a trip
through turnstile code.

This is diff reduction to a variant which uses atomic_fcmpset.

Discussed with:	jhb (previous version)
Tested by:	pho (previous version)
2017-01-03 21:36:15 +00:00
..
2017-01-03 21:00:24 +00:00
2017-01-03 16:46:51 +00:00
2016-12-27 20:22:17 +00:00
2017-01-03 17:35:16 +00:00
2016-12-21 01:39:11 +00:00
2017-01-03 21:36:15 +00:00
2016-12-26 11:06:41 +00:00
2016-11-26 23:15:11 +00:00
2016-12-10 03:31:38 +00:00
2017-01-03 21:36:15 +00:00