Fixing lock type in VFS.
This commit is contained in:
@@ -47,7 +47,7 @@ void Entry::Dump(xe::StringBuffer* string_buffer, int indent) {
|
||||
bool Entry::is_read_only() const { return device_->is_read_only(); }
|
||||
|
||||
Entry* Entry::GetChild(std::string name) {
|
||||
std::lock_guard<xe::mutex> lock(device_->mutex());
|
||||
std::lock_guard<xe::recursive_mutex> lock(device_->mutex());
|
||||
// TODO(benvanik): a faster search
|
||||
for (auto& child : children_) {
|
||||
if (strcasecmp(child->name().c_str(), name.c_str()) == 0) {
|
||||
@@ -59,7 +59,7 @@ Entry* Entry::GetChild(std::string name) {
|
||||
|
||||
Entry* Entry::IterateChildren(const xe::filesystem::WildcardEngine& engine,
|
||||
size_t* current_index) {
|
||||
std::lock_guard<xe::mutex> lock(device_->mutex());
|
||||
std::lock_guard<xe::recursive_mutex> lock(device_->mutex());
|
||||
while (*current_index < children_.size()) {
|
||||
auto& child = children_[*current_index];
|
||||
*current_index = *current_index + 1;
|
||||
@@ -74,7 +74,7 @@ Entry* Entry::CreateEntry(std::string name, uint32_t attributes) {
|
||||
if (is_read_only()) {
|
||||
return nullptr;
|
||||
}
|
||||
std::lock_guard<xe::mutex> lock(device_->mutex());
|
||||
std::lock_guard<xe::recursive_mutex> lock(device_->mutex());
|
||||
if (GetChild(name)) {
|
||||
// Already exists.
|
||||
return nullptr;
|
||||
@@ -93,7 +93,7 @@ bool Entry::Delete(Entry* entry) {
|
||||
if (is_read_only()) {
|
||||
return false;
|
||||
}
|
||||
std::lock_guard<xe::mutex> lock(device_->mutex());
|
||||
std::lock_guard<xe::recursive_mutex> lock(device_->mutex());
|
||||
if (entry->parent() != this) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user