Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-64266

QWaitCondition::wait with large timeout immediately returns

    XMLWordPrintable

Details

    • fd207c06b81b12086bdf80e4fa7b393bf1f424d6

    Description

      Calling

      QWaitCondition::wait(QMutex *mutex, unsigned long time)

      with time larger then INT_MAX, results in an immediate return (due to timeout).

      The problem

      The problem is related to the internal conversion of unsigned long to int, by calling

      void qt_abstime_for_timeout(struct timespec *ts, int timeout);

      in

      int QWaitConditionPrivate::wait_relative(unsigned long time)

      in file qwaitcondition_unix.cpp

      Possible solution

       Change the second argument of 

      void qt_abstime_for_timeout(struct timespec *ts, int timeout);

      from int to unsigned long:

      void qt_abstime_for_timeout(struct timespec *ts, unsigned long timeout);

      Attachments

        For Gerrit Dashboard: QTBUG-64266
        # Subject Branch Project Status CR V

        Activity

          People

            thiago Thiago Macieira
            skmyro Geert Mys
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes