Skip to content

Commit af7414b

Browse files
committed
using unique_lock instead of lock_guard
1 parent 0a8a742 commit af7414b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

libmamba/src/core/package_fetcher.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ namespace mamba
458458
void PackageFetcher::update_urls_txt() const
459459
{
460460
// TODO: check if this lock is really required
461-
std::lock_guard<std::mutex> lock(urls_txt_mutex);
461+
std::unique_lock lock{ urls_txt_mutex };
462462
const auto urls_file_path = m_cache_path / "urls.txt";
463463
std::ofstream urls_txt(urls_file_path.std_path(), std::ios::app);
464464
urls_txt << url() << std::endl;

libmamba/src/core/package_handling.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -740,7 +740,7 @@ namespace mamba
740740
void extract(const fs::u8path& file, const fs::u8path& dest, const ExtractOptions& options)
741741
{
742742
static std::mutex extract_mutex;
743-
std::lock_guard<std::mutex> lock(extract_mutex);
743+
std::unique_lock lock{ extract_mutex };
744744

745745
if (util::ends_with(file.string(), ".tar.bz2"))
746746
{

0 commit comments

Comments
 (0)