mirror of
https://github.com/trapexit/mergerfs.git
synced 2026-11-19 14:36:36 -05:00
Use debug mutex more
This commit is contained in:
parent
3f70e66ee3
commit
a2860c3f1f
26 changed files with 364 additions and 1156 deletions
|
|
@ -409,10 +409,7 @@ Branches::from_string(const std::string_view str_)
|
|||
Branches::Ptr impl;
|
||||
Branches::Ptr new_impl;
|
||||
|
||||
{
|
||||
std::lock_guard<std::mutex> lock_guard(_mutex);
|
||||
impl = _impl;
|
||||
}
|
||||
impl = std::atomic_load(&_impl);
|
||||
|
||||
new_impl = std::make_shared<Branches::Impl>(impl->minfreespace());
|
||||
*new_impl = *impl;
|
||||
|
|
@ -421,10 +418,7 @@ Branches::from_string(const std::string_view str_)
|
|||
if(rv < 0)
|
||||
return rv;
|
||||
|
||||
{
|
||||
std::lock_guard<std::mutex> lock_guard(_mutex);
|
||||
_impl = new_impl;
|
||||
}
|
||||
std::atomic_store(&_impl,new_impl);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -432,9 +426,7 @@ Branches::from_string(const std::string_view str_)
|
|||
std::string
|
||||
Branches::to_string(void) const
|
||||
{
|
||||
std::lock_guard<std::mutex> lock_guard(_mutex);
|
||||
|
||||
return _impl->to_string();
|
||||
return std::atomic_load(&_impl)->to_string();
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue