qt5base-lts/tests/auto/corelib
Alex Trotsenko cdbd68fc2f Allow QWinEventNotifier to coexist with waiting functions
Many subclasses of QIODevice have a functionality to block execution
until some asynchronous I/O operation completes. In case we are using
QWinEventNotifier, a typical reimplemented waitFor{ReadyRead
|BytesWritten}() function could look like:

  if (WaitForSingleObject(notifier.handle(),...) == WAIT_OBJECT_0) {
      notifier.setEnabled(false);
      ResetEvent(notifier.handle());

      bool res = GetOverlappedResult(...);
      ...
      return true;
  }

Despite the fact that the operation ends synchronously, it leaves the
notifier in a state that indicates it has received the event, so its
next call to setEnabled(true) will produce a fake notification.

So, we should reset a notifier's history before enabling it again.

Change-Id: I62a9dd809ce6a7a40e9d8038f2a49299b36f8142
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2018-03-27 15:08:46 +00:00
..
animation qtbase: cleanup BLACKLIST files 2018-02-13 15:20:33 +00:00
codecs Replace Q_DECL_OVERRIDE with override where possible 2017-09-19 11:53:42 +00:00
global Fix thread_local test 2018-02-23 13:23:01 +00:00
io Merge remote-tracking branch 'origin/5.11' into dev 2018-03-17 01:00:24 +01:00
itemmodels QSFPM: Faster row removes 2018-03-13 09:42:36 +00:00
kernel Allow QWinEventNotifier to coexist with waiting functions 2018-03-27 15:08:46 +00:00
mimetypes QMimeDatabase: fix regression in alias resolving 2018-02-28 22:17:58 +00:00
plugin tst_QLibrary: Ensure installation order of testdata libs 2018-03-02 07:20:04 +00:00
serialization JSON: remove braces from UUID text representations 2018-03-02 04:06:33 +00:00
statemachine Fix crash in tst_QStateMachine::dontProcessSlotsWhenMachineIsNotRunning 2018-02-14 08:12:20 +00:00
thread Merge remote-tracking branch 'origin/5.11' into dev 2018-03-21 08:59:26 +01:00
tools Add nullptr comparison to Q{Explicitly,}SharedDataPointer 2018-03-18 17:28:26 +00:00
corelib.pro Create corelib/serialization and move existing file formats into it 2018-01-26 20:59:50 +00:00