diff options
author | Ritt Konstantin <ritt.ks@gmail.com> | 2011-06-01 14:49:42 (GMT) |
---|---|---|
committer | Harald Fernengel <harald.fernengel@nokia.com> | 2011-06-01 14:49:42 (GMT) |
commit | 6896244f266becfb5807985c5628c8f0a775ce76 (patch) | |
tree | e6d8195c91ab50c65ab7403b00a5112e86f397f9 /src/gui/embedded/qwslock_p.h | |
parent | 4134cb7dfc04ca7721277772c41b678bac6b33a0 (diff) | |
download | Qt-6896244f266becfb5807985c5628c8f0a775ce76.zip Qt-6896244f266becfb5807985c5628c8f0a775ce76.tar.gz Qt-6896244f266becfb5807985c5628c8f0a775ce76.tar.bz2 |
minor refactoring of the QWSLock class
unify both constructors in a single one;
make the code cleaner and cheaper
Merge-request: 1237
Reviewed-by: Harald Fernengel <harald.fernengel@nokia.com>
Diffstat (limited to 'src/gui/embedded/qwslock_p.h')
-rw-r--r-- | src/gui/embedded/qwslock_p.h | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/gui/embedded/qwslock_p.h b/src/gui/embedded/qwslock_p.h index 9a7f279..d020b22 100644 --- a/src/gui/embedded/qwslock_p.h +++ b/src/gui/embedded/qwslock_p.h @@ -55,17 +55,16 @@ #include <qglobal.h> -QT_BEGIN_NAMESPACE - #ifndef QT_NO_QWS_MULTIPROCESS +QT_BEGIN_NAMESPACE + class QWSLock { public: enum LockType { BackingStore, Communication, RegionEvent }; - QWSLock(); - QWSLock(int lockId); + QWSLock(int lockId = -1); ~QWSLock(); bool lock(LockType type, int timeout = -1); @@ -75,11 +74,16 @@ public: int id() const { return semId; } private: + bool up(unsigned short semNum); + bool down(unsigned short semNum, int timeout); + int getValue(unsigned short semNum) const; + int semId; int lockCount[2]; }; - QT_END_NAMESPACE + #endif // QT_NO_QWS_MULTIPROCESS + #endif // QWSLOCK_P_H |