Uploaded image for project: 'Qt Mobility'
  1. Qt Mobility
  2. QTMOBILITY-1941

CActiveSchedulerWait is used all over QtMobility

    XMLWordPrintable

    Details

    • Commits:
      174f8aaceae6d05c06493281ab660f2a320e2240

      Description

      Qt code should be using QEventLoop when it has to force synchronous behaviour in naturally asynchronous cases. But QtMobility is using CActiveSchedulerWait instead. This causes active objects to run outside of Qt's round robin active scheduler and events to be processed without Qt's event loop being kicked as often as normal. For example, see QTTH-1494 and QTBUG-21928 for problems caused by this.

      Here's a list of places in QtMobility that use CActiveSchedulerWait.

      \qtmobility\src\connectivity\nfc\symbian\llcpsockettype1_symbian.cpp
      \qtmobility\src\connectivity\nfc\symbian\nearfieldtagasyncrequest_symbian.cpp
      \qtmobility\src\connectivity\nfc\symbian\llcpsockettype2_symbian.h
      \qtmobility\src\connectivity\nfc\symbian\nearfieldutility_symbian.h
      \qtmobility\src\connectivity\nfc\symbian\nearfieldtagasyncrequest_symbian.h
      \qtmobility\src\connectivity\nfc\symbian\llcpsockettype2_symbian.cpp
      \qtmobility\src\connectivity\nfc\symbian\nearfieldutility_symbian.cpp
      \qtmobility\src\connectivity\nfc\symbian\llcpsockettype1_symbian.h
      \qtmobility\src\location\qmlbackendmonitorcreatetriggerao_s60_p.h
      \qtmobility\src\location\qmlbackendmonitorcreatetriggerao_s60.cpp
      \qtmobility\src\systeminfo\symbian\tsrc\tst_qsystemdeviceinfo.cpp
      \qtmobility\src\systeminfo\symbian\telephonyinfo_s60.cpp
      \qtmobility\src\systeminfo\symbian\telephonyinfo_s60.h

      It is generally bad practice to force synchronous behaviour by nesting the active scheduler or event loop anyway. Much of this code should be re-written to handle the events asynchronously. This nested event loop style of code causes many defects all over the code base, by introducing unexpected re-entrancy conditions. It may be easy for you to write, but it's a huge pain in the arse for everyone who uses your code.

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            jukukkon Juha Kukkonen
            Reporter:
            mread Murray Read
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes