#include <kis_lock_free_lod_counter.h>
Definition at line 13 of file kis_lock_free_lod_counter.h.
◆ addLod()
| void KisLockFreeLodCounter::addLod |
( |
int | newLod | ) |
|
|
inline |
Definition at line 16 of file kis_lock_free_lod_counter.h.
16 {
17 int oldValue = 0;
18 int newValue = 0;
19
20 do {
22
23 int counter;
24 int lod;
26
27 if (!counter) {
28 lod = newLod;
29 } else {
30 Q_ASSERT(lod == newLod);
31 }
32
33 counter++;
34 newValue =
packLod(counter, lod);
35 }
while(!
m_num.testAndSetOrdered(oldValue, newValue));
36 }
static int packLod(int counter, int lod)
static void unpackLod(int value, int *counter, int *lod)
References m_num, packLod(), and unpackLod().
◆ packLod()
| static int KisLockFreeLodCounter::packLod |
( |
int | counter, |
|
|
int | lod ) |
|
inlinestaticprivate |
◆ readLod()
| int KisLockFreeLodCounter::readLod |
( |
| ) |
const |
|
inline |
◆ removeLod()
| void KisLockFreeLodCounter::removeLod |
( |
| ) |
|
|
inline |
Definition at line 38 of file kis_lock_free_lod_counter.h.
38 {
39 int oldValue = 0;
40 int newValue = 0;
41
42 do {
44
45 int counter;
46 int lod;
48
49 Q_ASSERT(counter > 0);
50
51 counter--;
52 newValue =
packLod(counter, lod);
53 }
while(!
m_num.testAndSetOrdered(oldValue, newValue));
54 }
References m_num, packLod(), and unpackLod().
◆ testingClear()
| void KisLockFreeLodCounter::testingClear |
( |
| ) |
|
|
inline |
◆ unpackLod()
| static void KisLockFreeLodCounter::unpackLod |
( |
int | value, |
|
|
int * | counter, |
|
|
int * | lod ) |
|
inlinestaticprivate |
◆ m_num
| QAtomicInt KisLockFreeLodCounter::m_num |
|
private |
The documentation for this class was generated from the following file: