QRecursiveMutex: make tryLock(QDeadlineTimer) the default (was: int)
The default argument staying on the old int overload meant that on Windows a nullary tryLock() call would need to go through both DLL- exported functions (int, then QDeadlineTimer) and on non-Windows platforms, it would hit the out-of-line QDeadlineTimer(qint64) ctor. By moving the default argument from the old to the new function, we reduce the nullary call on Windows from two to one exported functions. On non-Windows, we make it to hit QDeadlineTimer's constexpr inline default ctor instead. Found in API-review. Amends ff9da1db0b0963f967f45ab430ec40a3051b70b4. Pick-to: 6.6 Change-Id: Id3e9923cf97ee1673fe05c85c30b5a12531857b3 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
parent
02add2a807
commit
f780893c39
@ -181,8 +181,8 @@ public:
|
||||
void lock() QT_MUTEX_LOCK_NOEXCEPT
|
||||
{ tryLock(QDeadlineTimer(QDeadlineTimer::Forever)); }
|
||||
QT_CORE_INLINE_SINCE(6, 6)
|
||||
bool tryLock(int timeout = 0) QT_MUTEX_LOCK_NOEXCEPT;
|
||||
bool tryLock(QDeadlineTimer timer) QT_MUTEX_LOCK_NOEXCEPT;
|
||||
bool tryLock(int timeout) QT_MUTEX_LOCK_NOEXCEPT;
|
||||
bool tryLock(QDeadlineTimer timer = {}) QT_MUTEX_LOCK_NOEXCEPT;
|
||||
// BasicLockable concept
|
||||
void unlock() noexcept;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user