summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel
diff options
context:
space:
mode:
authorThomas McGuire <thomas.mcguire.qnx@kdab.com>2012-10-05 15:53:44 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-10-08 08:33:45 +0200
commit4a755752e919b8a6d68bea265c16c44b90eeb545 (patch)
treed43cb71ee318bd297b85f7eb48b9bdc25cfc8f18 /src/corelib/kernel
parentb72904e8540e4aa1f1396893f5d1b216d745cdc3 (diff)
QNX: Remove workaround for BPS bug
This BPS bug has been fixed with the latest BB10 release. Change-Id: I07f86f2d18b1e04f48b95a710d57864c69726c42 Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src/corelib/kernel')
-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 3cc01d7b82..626692c0d6 100644
--- a/src/corelib/kernel/qeventdispatcher_blackberry.cpp
+++ b/src/corelib/kernel/qeventdispatcher_blackberry.cpp
@@ -136,18 +136,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();
}
@@ -270,22 +272,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);
@@ -307,7 +293,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");
@@ -330,11 +316,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;
}