Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Monotonic timer for waitconditions with Qt 4.8.6

Monotonic timer for waitconditions with Qt 4.8.6

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
1 Posts 1 Posters 543 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    vbardelli
    wrote on last edited by vbardelli
    #1

    Hi all!

    I have a problem with Qt 4.8.6 both on my board (iMX6 solo board) and on my PC (l-ubuntu 16.04). With version 4.8.6 of Qt, if I set the date before the time when threads start, all threads stops, until I report the date after the time when threads start.

    If I ask to Qt which type of clock are in use, It says to me that the clock is monotonic, but this is not the case...

    I have no problem using timers an waitcondition from glibc...

    Have you ever seen this problem?

    Any suggestion is really appreciated!

    Update: just to understand better I created a QtCreator project with three threads: the first one uses msleep to sleep for 1 sec, the second one uses a mutex timeout (mywait.wait(&mymutex, 1000);) to sleep for 1 sec, the third one uses a normal sleep from glibc to sleep 1 sec. I can send you this simple project, if you want, but I'm not able to attach it here, unfortunately. :(((

    If you run this program from a terminal, you can see the print from all the three threads. Then, open another terminal and set your system clock some minutes BEHIND (with a simple date +%T -s "xx:xx:xx" command). Now you can see, with Qt 4.8.5 and Qt 4.8.6, that the first two threads stops!

    If you try to ask to Qt which type of clock are in use (with QElapsedTimer::clockType() or QElapsedTimer::isMonotonic()) you will receive the response that the clock is monotonic...

    If you use Qt5 you will have not this problem...

    Is this a bug? Any idea about?

    Thanks a lot!

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved