mutex.cc
115 KB
-
Small Mutex::Unlock optimization · 482ca0b9
Saving one "&" operation in the Mutex::Unlock fast path. This has likely no performance impact (the two AND instructions ran in parallel anyway), but is as complex as the current solution, and enables two possible improvements in the future. 1. If bits Ev, Wr, Wa, De are made into the highest bits in the kMuLow, then the second "&" operation can be omitted because if kMuWriter is set, the there are no readers, so the kMuHigh bits are zero. 2. If the meanings of kMuWriter and kMuDesig are flipped, then the "^" operation is not needed either. PiperOrigin-RevId: 679272590 Change-Id: Iea7a04df0118d2410b7bfdab70b30e33d4b90e43
piotrzielinski committed