mirror of
https://github.com/trapexit/mergerfs.git
synced 2026-11-25 09:26:25 -05:00
Use shared_mutex for ReadDir state
- Replace atomic shared pointer loads/stores with shared/unique locking. - Store the configured readdir mode directly as std::string. - Copy the active ReadDir implementation under lock before invoking it.
This commit is contained in:
parent
e9301e7969
commit
e48cbe2185
2 changed files with 25 additions and 18 deletions
|
|
@ -22,9 +22,9 @@
|
|||
#include "tofrom_string.hpp"
|
||||
#include "fuse_readdir_base.hpp"
|
||||
|
||||
#include <atomic>
|
||||
#include <memory>
|
||||
#include <mutex>
|
||||
#include <shared_mutex>
|
||||
|
||||
|
||||
namespace FUSE
|
||||
|
|
@ -59,8 +59,9 @@ namespace FUSE
|
|||
void initialize();
|
||||
|
||||
private:
|
||||
std::atomic<bool> _initialized = false;
|
||||
std::shared_ptr<std::string> _str;
|
||||
bool _initialized = false;
|
||||
mutable std::shared_mutex _mutex;
|
||||
std::string _str;
|
||||
std::shared_ptr<FUSE::ReadDirBase> _impl;
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue