Simplify the futex lock loop: no need for nested while
authorThiago Macieira <thiago.macieira@intel.com>
Sat, 11 Aug 2012 12:47:10 +0000 (14:47 +0200)
committerQt by Nokia <qt-info@nokia.com>
Fri, 14 Sep 2012 01:45:50 +0000 (03:45 +0200)
commitfc174a37283306f3f5c06efeda22d5164820c164
tree3e96b1d780babc36425866f38fab214d51fccc1c
parent30bea611df2d95b53b63273ac867d9bd0a181edf
Simplify the futex lock loop: no need for nested while

Once we enter the inner loop, we never exit it except to return from
the lockInternal() function, so the rest is never executed again.

As a consequence of this, we won't try to fastTryLock() twice per
mutex. Therefore, for a non-recursive mutex, if lockInternal() is
entered, we'll definitely need to use futexes.

Change-Id: Ice617ed27449c1fbdc112a159a86cd0660125e13
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
src/corelib/thread/qmutex_linux.cpp