Definition at line 21 of file KisTiledExtentManager.h.
◆ Data()
| KisTiledExtentManager::Data::Data |
( |
| ) |
|
◆ ~Data()
| KisTiledExtentManager::Data::~Data |
( |
| ) |
|
◆ add()
| bool KisTiledExtentManager::Data::add |
( |
qint32 | index | ) |
|
Definition at line 31 of file KisTiledExtentManager.cpp.
32{
34 qint32 currentIndex =
m_offset + index;
35
36 if (currentIndex < 0 || currentIndex >=
m_capacity) {
37 lock.unlock();
39 lock.relock();
41 }
42
44 bool needsUpdateExtent = false;
45
46 while (true) {
48
49 int oldValue =
m_buffer[currentIndex].loadAcquire();
50 if (oldValue == 0) {
51 rl.unlock();
53
54 if ((oldValue =
m_buffer[currentIndex].loadAcquire()) == 0) {
55
58
60 needsUpdateExtent = true;
61
62 m_buffer[currentIndex].storeRelease(1);
63 } else {
64 m_buffer[currentIndex].storeRelease(oldValue + 1);
65 }
66
67 break;
68 }
else if (
m_buffer[currentIndex].testAndSetOrdered(oldValue, oldValue + 1)) {
69 break;
70 }
71 }
72
73 return needsUpdateExtent;
74}
QReadWriteLock m_extentLock
void migrate(qint32 index)
#define KIS_ASSERT_RECOVER_NOOP(cond)
References KIS_ASSERT_RECOVER_NOOP, and KisTiledExtentManager::m_extentLock.
◆ clear()
| void KisTiledExtentManager::Data::clear |
( |
| ) |
|
◆ isEmpty()
| bool KisTiledExtentManager::Data::isEmpty |
( |
| ) |
|
◆ max()
| qint32 KisTiledExtentManager::Data::max |
( |
| ) |
|
◆ migrate()
| void KisTiledExtentManager::Data::migrate |
( |
qint32 | index | ) |
|
|
inlineprivate |
◆ min()
| qint32 KisTiledExtentManager::Data::min |
( |
| ) |
|
◆ remove()
| bool KisTiledExtentManager::Data::remove |
( |
qint32 | index | ) |
|
That is not the droid you're looking for. If you see this assert in the backtrace, most probably, the bug is not here. The crash happens because two threads are trying to do device->clear(rc) concurrently for the overlapping rects. That is, they are trying to remove the same tile. Look higher!
Definition at line 76 of file KisTiledExtentManager.cpp.
77{
79 qint32 currentIndex =
m_offset + index;
80
81 bool needsUpdateExtent = false;
83
84 const int oldValue =
m_buffer[currentIndex].fetchAndAddAcquire(-1);
85
94 m_buffer[currentIndex].storeRelaxed(0);
95 return false;
96 }
97
98 if (oldValue == 1) {
99 rl.unlock();
101
104
106 needsUpdateExtent = true;
107 }
108
109 return needsUpdateExtent;
110}
#define KIS_SAFE_ASSERT_RECOVER(cond)
References KIS_SAFE_ASSERT_RECOVER, and KisTiledExtentManager::m_extentLock.
◆ replace()
| void KisTiledExtentManager::Data::replace |
( |
const QVector< qint32 > & | indexes | ) |
|
◆ unsafeAdd()
| void KisTiledExtentManager::Data::unsafeAdd |
( |
qint32 | index | ) |
|
|
inlineprivate |
◆ unsafeMigrate()
| void KisTiledExtentManager::Data::unsafeMigrate |
( |
qint32 | index | ) |
|
|
inlineprivate |
Definition at line 175 of file KisTiledExtentManager.cpp.
176{
179 qint32 currentIndex =
m_offset + index;
180
181 while (currentIndex < 0 || currentIndex >=
m_capacity) {
183
184 if (currentIndex < 0) {
187 }
188 }
189
191 QAtomicInt *newBuffer =
new QAtomicInt[
m_capacity];
192 qint32 start =
m_offset - oldOffset;
193
194 for (qint32 i = 0; i < oldCapacity; ++i) {
195 newBuffer[start + i].storeRelaxed(
m_buffer[i].loadRelaxed());
196 }
197
200 }
201}
◆ updateMax()
| void KisTiledExtentManager::Data::updateMax |
( |
| ) |
|
|
inlineprivate |
◆ updateMin()
| void KisTiledExtentManager::Data::updateMin |
( |
| ) |
|
|
inlineprivate |
◆ m_buffer
| QAtomicInt* KisTiledExtentManager::Data::m_buffer |
|
private |
◆ m_capacity
| qint32 KisTiledExtentManager::Data::m_capacity |
|
private |
◆ m_count
| qint32 KisTiledExtentManager::Data::m_count |
|
private |
◆ m_extentLock
| QReadWriteLock KisTiledExtentManager::Data::m_extentLock |
◆ m_max
| qint32 KisTiledExtentManager::Data::m_max |
|
private |
◆ m_migrationLock
| QReadWriteLock KisTiledExtentManager::Data::m_migrationLock |
|
private |
◆ m_min
| qint32 KisTiledExtentManager::Data::m_min |
|
private |
◆ m_offset
| qint32 KisTiledExtentManager::Data::m_offset |
|
private |
The documentation for this class was generated from the following files: