From 72f57cc84244633ca69ede9a1fd510b9b1881c1d Mon Sep 17 00:00:00 2001 From: Christian Ehrlicher Date: Wed, 6 Nov 2019 17:59:49 +0100 Subject: QWaitCondition: mark obsolete functions as deprecated Mark QWaitCondition:wait(..., ulong) as deprecated so they can be removed in Qt6. Also replace the usages of this deprecated functions inside QtCore. Change-Id: I77313255fa05f5c112b0b40d4c55339cc4f85346 Reviewed-by: Thiago Macieira --- src/corelib/thread/qwaitcondition.qdoc | 34 +++++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 11 deletions(-) (limited to 'src/corelib/thread/qwaitcondition.qdoc') diff --git a/src/corelib/thread/qwaitcondition.qdoc b/src/corelib/thread/qwaitcondition.qdoc index eebc28f059..9da6f6f25c 100644 --- a/src/corelib/thread/qwaitcondition.qdoc +++ b/src/corelib/thread/qwaitcondition.qdoc @@ -119,10 +119,22 @@ \sa wakeOne() */ +#if QT_DEPRECATED_SINCE(5, 15) /*! \fn bool QWaitCondition::wait(QMutex *lockedMutex, unsigned long time) + \obsolete use wait(QMutex *lockedMutex, QDeadlineTimer deadline) instead +*/ +/*! + \fn bool QWaitCondition::wait(QReadWriteLock *lockedReadWriteLock, unsigned long time) + \obsolete use wait(QReadWriteLock *lockedReadWriteLock, QDeadlineTimer deadline) instead +*/ +#endif - Releases the \a lockedMutex and waits on the wait condition. The +/*! + \fn bool QWaitCondition::wait(QMutex *lockedMutex, QDeadlineTimer deadline) + \since 5.12 + + Releases the \a lockedMutex and waits on the wait condition. The \a lockedMutex must be initially locked by the calling thread. If \a lockedMutex is not in a locked state, the behavior is undefined. If \a lockedMutex is a recursive mutex, this function @@ -132,10 +144,10 @@ \list \li Another thread signals it using wakeOne() or wakeAll(). This function will return true in this case. - \li \a time milliseconds has elapsed. If \a time is \c ULONG_MAX - (the default), then the wait will never timeout (the event - must be signalled). This function will return false if the - wait timed out. + \li the deadline given by \a deadline is reached. If \a deadline is + \c QDeadlineTimer::Forever (the default), then the wait will never + timeout (the event must be signalled). This function will return + false if the wait timed out. \endlist The \a lockedMutex will be returned to the same locked state. This @@ -146,8 +158,8 @@ */ /*! - \fn bool QWaitCondition::wait(QReadWriteLock *lockedReadWriteLock, unsigned long time) - \since 4.4 + \fn bool QWaitCondition::wait(QReadWriteLock *lockedReadWriteLock, QDeadlineTimer deadline) + \since 5.12 Releases the \a lockedReadWriteLock and waits on the wait condition. The \a lockedReadWriteLock must be initially locked by the @@ -160,10 +172,10 @@ \list \li Another thread signals it using wakeOne() or wakeAll(). This function will return true in this case. - \li \a time milliseconds has elapsed. If \a time is \c ULONG_MAX - (the default), then the wait will never timeout (the event - must be signalled). This function will return false if the - wait timed out. + \li the deadline given by \a deadline is reached. If \a deadline is + \c QDeadlineTimer::Forever (the default), then the wait will never + timeout (the event must be signalled). This function will return + false if the wait timed out. \endlist The \a lockedReadWriteLock will be returned to the same locked -- cgit v1.2.3 From b89f2ebd9543d4cf60821a9c3cc12547d7d2253e Mon Sep 17 00:00:00 2001 From: Christian Ehrlicher Date: Fri, 22 Nov 2019 23:19:34 +0100 Subject: QWaitCondition: un-deprecate wait() functions with ulong arg The wait() functions with the unsigned long arg were marked for removal for Qt6 but due to the high usage of this functions and the very small gain, revert the deprecation. Change-Id: I9c9b720d279a59d87730f51de0f321b3794aa88e Reviewed-by: Paul Wicking Reviewed-by: Thiago Macieira --- src/corelib/thread/qwaitcondition.qdoc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/corelib/thread/qwaitcondition.qdoc') diff --git a/src/corelib/thread/qwaitcondition.qdoc b/src/corelib/thread/qwaitcondition.qdoc index 9da6f6f25c..014d549477 100644 --- a/src/corelib/thread/qwaitcondition.qdoc +++ b/src/corelib/thread/qwaitcondition.qdoc @@ -119,16 +119,14 @@ \sa wakeOne() */ -#if QT_DEPRECATED_SINCE(5, 15) /*! \fn bool QWaitCondition::wait(QMutex *lockedMutex, unsigned long time) - \obsolete use wait(QMutex *lockedMutex, QDeadlineTimer deadline) instead + \overload */ /*! \fn bool QWaitCondition::wait(QReadWriteLock *lockedReadWriteLock, unsigned long time) - \obsolete use wait(QReadWriteLock *lockedReadWriteLock, QDeadlineTimer deadline) instead + \overload */ -#endif /*! \fn bool QWaitCondition::wait(QMutex *lockedMutex, QDeadlineTimer deadline) -- cgit v1.2.3