| Absolute File Name: | /home/qt/qt5_coco/qt5/qtbase/src/corelib/kernel/qsystemsemaphore.cpp |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||||||||||||||
| 2 | - | |||||||||||||||||||||||||
| 3 | QSystemSemaphore::QSystemSemaphore(const QString &key, int initialValue, AccessMode mode) | - | ||||||||||||||||||||||||
| 4 | : d(new QSystemSemaphorePrivate) | - | ||||||||||||||||||||||||
| 5 | { | - | ||||||||||||||||||||||||
| 6 | setKey(key, initialValue, mode); | - | ||||||||||||||||||||||||
| 7 | } executed 3735 times by 5 tests: end of blockExecuted by:
| 3735 | ||||||||||||||||||||||||
| 8 | QSystemSemaphore::~QSystemSemaphore() | - | ||||||||||||||||||||||||
| 9 | { | - | ||||||||||||||||||||||||
| 10 | d->cleanHandle(); | - | ||||||||||||||||||||||||
| 11 | } executed 3734 times by 4 tests: end of blockExecuted by:
| 3734 | ||||||||||||||||||||||||
| 12 | void QSystemSemaphore::setKey(const QString &key, int initialValue, AccessMode mode) | - | ||||||||||||||||||||||||
| 13 | { | - | ||||||||||||||||||||||||
| 14 | if (key == d->key
| 3521-10883 | ||||||||||||||||||||||||
| 15 | return; executed 7362 times by 4 tests: return;Executed by:
| 7362 | ||||||||||||||||||||||||
| 16 | d->clearError(); | - | ||||||||||||||||||||||||
| 17 | - | |||||||||||||||||||||||||
| 18 | - | |||||||||||||||||||||||||
| 19 | if (key == d->key
| 0-3666 | ||||||||||||||||||||||||
| 20 | d->initialValue = initialValue; | - | ||||||||||||||||||||||||
| 21 | d->unix_key = -1; | - | ||||||||||||||||||||||||
| 22 | d->handle(mode); | - | ||||||||||||||||||||||||
| 23 | return; executed 3466 times by 2 tests: return;Executed by:
| 3466 | ||||||||||||||||||||||||
| 24 | } | - | ||||||||||||||||||||||||
| 25 | - | |||||||||||||||||||||||||
| 26 | d->cleanHandle(); | - | ||||||||||||||||||||||||
| 27 | d->key = key; | - | ||||||||||||||||||||||||
| 28 | d->initialValue = initialValue; | - | ||||||||||||||||||||||||
| 29 | - | |||||||||||||||||||||||||
| 30 | d->fileName = d->makeKeyFileName(); | - | ||||||||||||||||||||||||
| 31 | d->handle(mode); | - | ||||||||||||||||||||||||
| 32 | } executed 3721 times by 4 tests: end of blockExecuted by:
| 3721 | ||||||||||||||||||||||||
| 33 | - | |||||||||||||||||||||||||
| 34 | - | |||||||||||||||||||||||||
| 35 | - | |||||||||||||||||||||||||
| 36 | - | |||||||||||||||||||||||||
| 37 | - | |||||||||||||||||||||||||
| 38 | - | |||||||||||||||||||||||||
| 39 | - | |||||||||||||||||||||||||
| 40 | QString QSystemSemaphore::key() const | - | ||||||||||||||||||||||||
| 41 | { | - | ||||||||||||||||||||||||
| 42 | return executed 6 times by 1 test: d->key;return d->key;Executed by:
executed 6 times by 1 test: return d->key;Executed by:
| 6 | ||||||||||||||||||||||||
| 43 | } | - | ||||||||||||||||||||||||
| 44 | bool QSystemSemaphore::acquire() | - | ||||||||||||||||||||||||
| 45 | { | - | ||||||||||||||||||||||||
| 46 | return executed 7661 times by 4 tests: d->modifySemaphore(-1);return d->modifySemaphore(-1);Executed by:
executed 7661 times by 4 tests: return d->modifySemaphore(-1);Executed by:
| 7661 | ||||||||||||||||||||||||
| 47 | } | - | ||||||||||||||||||||||||
| 48 | bool QSystemSemaphore::release(int n) | - | ||||||||||||||||||||||||
| 49 | { | - | ||||||||||||||||||||||||
| 50 | if (n == 0
| 0-7659 | ||||||||||||||||||||||||
| 51 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||||||||||||||
| 52 | if (n < 0
| 0-7659 | ||||||||||||||||||||||||
| 53 | QMessageLogger(__FILE__, 303, __PRETTY_FUNCTION__).warning("QSystemSemaphore::release: n is negative."); | - | ||||||||||||||||||||||||
| 54 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 55 | } | - | ||||||||||||||||||||||||
| 56 | return executed 7659 times by 4 tests: d->modifySemaphore(n);return d->modifySemaphore(n);Executed by:
executed 7659 times by 4 tests: return d->modifySemaphore(n);Executed by:
| 7659 | ||||||||||||||||||||||||
| 57 | } | - | ||||||||||||||||||||||||
| 58 | - | |||||||||||||||||||||||||
| 59 | - | |||||||||||||||||||||||||
| 60 | - | |||||||||||||||||||||||||
| 61 | - | |||||||||||||||||||||||||
| 62 | - | |||||||||||||||||||||||||
| 63 | - | |||||||||||||||||||||||||
| 64 | - | |||||||||||||||||||||||||
| 65 | QSystemSemaphore::SystemSemaphoreError QSystemSemaphore::error() const | - | ||||||||||||||||||||||||
| 66 | { | - | ||||||||||||||||||||||||
| 67 | return executed 3721 times by 3 tests: d->error;return d->error;Executed by:
executed 3721 times by 3 tests: return d->error;Executed by:
| 3721 | ||||||||||||||||||||||||
| 68 | } | - | ||||||||||||||||||||||||
| 69 | QString QSystemSemaphore::errorString() const | - | ||||||||||||||||||||||||
| 70 | { | - | ||||||||||||||||||||||||
| 71 | return executed 9 times by 1 test: d->errorString;return d->errorString;Executed by:
executed 9 times by 1 test: return d->errorString;Executed by:
| 9 | ||||||||||||||||||||||||
| 72 | } | - | ||||||||||||||||||||||||
| 73 | - | |||||||||||||||||||||||||
| 74 | - | |||||||||||||||||||||||||
| 75 | - | |||||||||||||||||||||||||
| 76 | - | |||||||||||||||||||||||||
| Switch to Source code | Preprocessed file |