mirror of
https://review.haiku-os.org/haiku
synced 2025-01-18 12:38:51 +01:00
ramfs: Add iterator locking to index classes.
This commit is contained in:
parent
5ac03c3714
commit
ebc6bc8ed7
@ -17,6 +17,9 @@
|
||||
#include "TwoKeyAVLTree.h"
|
||||
#include "Volume.h"
|
||||
|
||||
#include <util/AutoLock.h>
|
||||
|
||||
|
||||
// compare_integral
|
||||
template<typename Key>
|
||||
static inline
|
||||
@ -341,6 +344,7 @@ AttributeIndexImpl::InternalFind(const uint8 *key, size_t length)
|
||||
void
|
||||
AttributeIndexImpl::_AddIterator(Iterator *iterator)
|
||||
{
|
||||
RecursiveLocker locker(fVolume->GetAttributeIteratorLock());
|
||||
fIterators->Insert(iterator);
|
||||
}
|
||||
|
||||
@ -348,6 +352,7 @@ AttributeIndexImpl::_AddIterator(Iterator *iterator)
|
||||
void
|
||||
AttributeIndexImpl::_RemoveIterator(Iterator *iterator)
|
||||
{
|
||||
RecursiveLocker locker(fVolume->GetAttributeIteratorLock());
|
||||
fIterators->Remove(iterator);
|
||||
}
|
||||
|
||||
|
@ -14,6 +14,9 @@
|
||||
#include "NodeListener.h"
|
||||
#include "Volume.h"
|
||||
|
||||
#include <util/AutoLock.h>
|
||||
|
||||
|
||||
// LastModifiedIndexPrimaryKey
|
||||
class LastModifiedIndexPrimaryKey {
|
||||
public:
|
||||
@ -226,6 +229,7 @@ LastModifiedIndex::InternalFind(const uint8 *key, size_t length)
|
||||
void
|
||||
LastModifiedIndex::_AddIterator(Iterator *iterator)
|
||||
{
|
||||
RecursiveLocker locker(fVolume->GetAttributeIteratorLock());
|
||||
fIterators->Insert(iterator);
|
||||
}
|
||||
|
||||
@ -233,6 +237,7 @@ LastModifiedIndex::_AddIterator(Iterator *iterator)
|
||||
void
|
||||
LastModifiedIndex::_RemoveIterator(Iterator *iterator)
|
||||
{
|
||||
RecursiveLocker locker(fVolume->GetAttributeIteratorLock());
|
||||
fIterators->Remove(iterator);
|
||||
}
|
||||
|
||||
|
@ -13,6 +13,9 @@
|
||||
#include "SizeIndex.h"
|
||||
#include "Volume.h"
|
||||
|
||||
#include <util/AutoLock.h>
|
||||
|
||||
|
||||
// SizeIndexPrimaryKey
|
||||
class SizeIndexPrimaryKey {
|
||||
public:
|
||||
@ -225,6 +228,7 @@ SizeIndex::InternalFind(const uint8 *key, size_t length)
|
||||
void
|
||||
SizeIndex::_AddIterator(Iterator *iterator)
|
||||
{
|
||||
RecursiveLocker locker(fVolume->GetAttributeIteratorLock());
|
||||
fIterators->Insert(iterator);
|
||||
}
|
||||
|
||||
@ -232,6 +236,7 @@ SizeIndex::_AddIterator(Iterator *iterator)
|
||||
void
|
||||
SizeIndex::_RemoveIterator(Iterator *iterator)
|
||||
{
|
||||
RecursiveLocker locker(fVolume->GetAttributeIteratorLock());
|
||||
fIterators->Remove(iterator);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user