diff options
author | Ritt Konstantin <ritt.ks@gmail.com> | 2011-06-01 14:49:35 (GMT) |
---|---|---|
committer | Harald Fernengel <harald.fernengel@nokia.com> | 2011-06-01 14:49:35 (GMT) |
commit | 9a4d1230b54c15af6f5448c1551c35242b668ccf (patch) | |
tree | 9bd6030ebf258d3e825606e08f6c94835c61c0fc /src/gui/embedded/qwslock.cpp | |
parent | c7c39a79f2d31c7f6a745e5169d4cb145662f652 (diff) | |
download | Qt-9a4d1230b54c15af6f5448c1551c35242b668ccf.zip Qt-9a4d1230b54c15af6f5448c1551c35242b668ccf.tar.gz Qt-9a4d1230b54c15af6f5448c1551c35242b668ccf.tar.bz2 |
fix build with QT_NO_QWS_SIGNALHANDLER
Merge-request: 1237
Reviewed-by: Harald Fernengel <harald.fernengel@nokia.com>
Diffstat (limited to 'src/gui/embedded/qwslock.cpp')
-rw-r--r-- | src/gui/embedded/qwslock.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/gui/embedded/qwslock.cpp b/src/gui/embedded/qwslock.cpp index a64dc3d..1d9bfb6 100644 --- a/src/gui/embedded/qwslock.cpp +++ b/src/gui/embedded/qwslock.cpp @@ -76,7 +76,9 @@ QWSLock::QWSLock() perror("QWSLock::QWSLock"); qFatal("Unable to create semaphore"); } +#ifndef QT_NO_QWS_SIGNALHANDLER QWSSignalHandler::instance()->addSemaphore(semId); +#endif qt_semun semval; semval.val = 1; @@ -103,15 +105,23 @@ QWSLock::QWSLock() QWSLock::QWSLock(int id) { semId = id; +#ifndef QT_NO_QWS_SIGNALHANDLER QWSSignalHandler::instance()->addSemaphore(semId); +#endif lockCount[0] = lockCount[1] = 0; } QWSLock::~QWSLock() { - if (semId == -1) - return; - QWSSignalHandler::instance()->removeSemaphore(semId); + if (semId != -1) { +#ifndef QT_NO_QWS_SIGNALHANDLER + QWSSignalHandler::instance()->removeSemaphore(semId); +#else + qt_semun semval; + semval.val = 0; + semctl(semId, 0, IPC_RMID, semval); +#endif + } } static bool forceLock(int semId, unsigned short semNum, int) |