QReadWriteLock: Resolve a redefinition issue
This collides with a similarly name struct/object in qmutex.cpp. Task-number: QTBUG-109394 Change-Id: I29404f092db523e21f310b4e5b3cd8cc35170e4a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 950e9dad0e7f1fafb45b7cbb6aa6673af613cd07) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
dd76ed90ed
commit
beae44ed9d
@ -580,25 +580,24 @@ void QReadWriteLockPrivate::recursiveUnlock()
|
|||||||
|
|
||||||
// The freelist management
|
// The freelist management
|
||||||
namespace {
|
namespace {
|
||||||
struct FreeListConstants : QFreeListDefaultConstants {
|
struct QReadWriteLockFreeListConstants : QFreeListDefaultConstants
|
||||||
|
{
|
||||||
enum { BlockCount = 4, MaxIndex=0xffff };
|
enum { BlockCount = 4, MaxIndex=0xffff };
|
||||||
static const int Sizes[BlockCount];
|
static const int Sizes[BlockCount];
|
||||||
};
|
};
|
||||||
Q_CONSTINIT const int FreeListConstants::Sizes[FreeListConstants::BlockCount] = {
|
Q_CONSTINIT const int
|
||||||
16,
|
QReadWriteLockFreeListConstants::Sizes[QReadWriteLockFreeListConstants::BlockCount] = {
|
||||||
128,
|
16, 128, 1024, QReadWriteLockFreeListConstants::MaxIndex - (16 + 128 + 1024)
|
||||||
1024,
|
};
|
||||||
FreeListConstants::MaxIndex - (16 + 128 + 1024)
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef QFreeList<QReadWriteLockPrivate, FreeListConstants> FreeList;
|
typedef QFreeList<QReadWriteLockPrivate, QReadWriteLockFreeListConstants> QReadWriteLockFreeList;
|
||||||
Q_GLOBAL_STATIC(FreeList, freelist);
|
Q_GLOBAL_STATIC(QReadWriteLockFreeList, qrwl_freelist);
|
||||||
}
|
}
|
||||||
|
|
||||||
QReadWriteLockPrivate *QReadWriteLockPrivate::allocate()
|
QReadWriteLockPrivate *QReadWriteLockPrivate::allocate()
|
||||||
{
|
{
|
||||||
int i = freelist->next();
|
int i = qrwl_freelist->next();
|
||||||
QReadWriteLockPrivate *d = &(*freelist)[i];
|
QReadWriteLockPrivate *d = &(*qrwl_freelist)[i];
|
||||||
d->id = i;
|
d->id = i;
|
||||||
Q_ASSERT(!d->recursive);
|
Q_ASSERT(!d->recursive);
|
||||||
Q_ASSERT(!d->waitingReaders && !d->waitingWriters && !d->readerCount && !d->writerCount);
|
Q_ASSERT(!d->waitingReaders && !d->waitingWriters && !d->readerCount && !d->writerCount);
|
||||||
@ -609,7 +608,7 @@ void QReadWriteLockPrivate::release()
|
|||||||
{
|
{
|
||||||
Q_ASSERT(!recursive);
|
Q_ASSERT(!recursive);
|
||||||
Q_ASSERT(!waitingReaders && !waitingWriters && !readerCount && !writerCount);
|
Q_ASSERT(!waitingReaders && !waitingWriters && !readerCount && !writerCount);
|
||||||
freelist->release(id);
|
qrwl_freelist->release(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
Loading…
x
Reference in New Issue
Block a user