summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorThomas McGuire <thomas.mcguire.qnx@kdab.com>2012-10-05 12:14:31 (GMT)
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-10-12 00:19:36 (GMT)
commit1774d800d9a14ed26e6be12b8461994ea38ed478 (patch)
treee528f065c9c74d9c51c11b2b7684d1c0dd6aa392 /src/corelib
parent23a0d7f1235e09875e8ca067758b40a9df4669a5 (diff)
downloadQt-1774d800d9a14ed26e6be12b8461994ea38ed478.zip
Qt-1774d800d9a14ed26e6be12b8461994ea38ed478.tar.gz
Qt-1774d800d9a14ed26e6be12b8461994ea38ed478.tar.bz2
QNX: Remove workaround for BPS bug
This BPS bug has been fixed with the latest BB10 release. This is a backport of qtbase commit 4a755752e919b8a6d68bea265c16c44b90eeb545 Change-Id: Ifa9fb9efd8c12aef6e554f5bf7a731fdf983f83d Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com> Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com>
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/kernel/qeventdispatcher_blackberry.cpp31
1 files changed, 6 insertions, 25 deletions
diff --git a/src/corelib/kernel/qeventdispatcher_blackberry.cpp b/src/corelib/kernel/qeventdispatcher_blackberry.cpp
index 921dfdb..483171b 100644
--- a/src/corelib/kernel/qeventdispatcher_blackberry.cpp
+++ b/src/corelib/kernel/qeventdispatcher_blackberry.cpp
@@ -137,18 +137,20 @@ QEventDispatcherBlackberryPrivate::QEventDispatcherBlackberryPrivate()
qWarning("QEventDispatcherBlackberryPrivate::QEventDispatcherBlackberry: bps_register_domain() failed");
}
- // \TODO Reinstate this when bps is fixed. See comment in select() below.
// Register thread_pipe[0] with bps
- /*
int io_events = BPS_IO_INPUT;
result = bps_add_fd(thread_pipe[0], io_events, &bpsIOHandler, ioData.data());
if (result != BPS_SUCCESS)
qWarning() << Q_FUNC_INFO << "bps_add_fd() failed";
- */
}
QEventDispatcherBlackberryPrivate::~QEventDispatcherBlackberryPrivate()
{
+ // Unregister thread_pipe[0] from bps
+ const int result = bps_remove_fd(thread_pipe[0]);
+ if (result != BPS_SUCCESS)
+ qWarning() << Q_FUNC_INFO << "bps_remove_fd() failed";
+
// we're done using BPS
bps_shutdown();
}
@@ -271,22 +273,6 @@ int QEventDispatcherBlackberry::select(int nfds, fd_set *readfds, fd_set *writef
d->ioData->writefds = writefds;
d->ioData->exceptfds = exceptfds;
- // \TODO Remove this when bps is fixed
- //
- // Work around a bug in BPS with which if we register the thread_pipe[0] fd with bps in the
- // private class' ctor once only then we get spurious notifications that thread_pipe[0] is
- // ready for reading. The first time the notification is correct and the pipe is emptied in
- // the calling doSelect() function. The 2nd notification is an error and the resulting attempt
- // to read and call to wakeUps.testAndSetRelease(1, 0) fails as there has been no intervening
- // call to QEventDispatcherUNIX::wakeUp().
- //
- // Registering thread_pipe[0] here and unregistering it at the end of this call works around
- // this issue.
- int io_events = BPS_IO_INPUT;
- int result = bps_add_fd(d->thread_pipe[0], io_events, &bpsIOHandler, d->ioData.data());
- if (result != BPS_SUCCESS)
- qWarning() << Q_FUNC_INFO << "bps_add_fd() failed";
-
// reset all file sets
if (readfds)
FD_ZERO(readfds);
@@ -308,7 +294,7 @@ int QEventDispatcherBlackberry::select(int nfds, fd_set *readfds, fd_set *writef
forever {
// Wait for event or file to be ready
bps_event_t *event = NULL;
- result = bps_get_event(&event, timeout_bps);
+ const int result = bps_get_event(&event, timeout_bps);
if (result != BPS_SUCCESS)
qWarning("QEventDispatcherBlackberry::select: bps_get_event() failed");
@@ -331,11 +317,6 @@ int QEventDispatcherBlackberry::select(int nfds, fd_set *readfds, fd_set *writef
break;
}
- // \TODO Remove this when bps is fixed (see comment above)
- result = bps_remove_fd(d->thread_pipe[0]);
- if (result != BPS_SUCCESS)
- qWarning() << Q_FUNC_INFO << "bps_remove_fd() failed";
-
// the number of bits set in the file sets
return d->ioData->count;
}