aboutsummaryrefslogtreecommitdiff
path: root/paludis/repositories/e
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2013-05-16 20:03:48 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2013-05-22 23:19:18 +0100
commit78d9a9bf0758140e0e8c03c5e8d3288f74efbb51 (patch)
tree1c0b25ba6358e80d0fe535fb49e3cce8d243e6a3 /paludis/repositories/e
parent39834ca3b05fadb14f855a8ab6dcea98c35738a7 (diff)
downloadpaludis-78d9a9bf0758140e0e8c03c5e8d3288f74efbb51.tar.gz
paludis-78d9a9bf0758140e0e8c03c5e8d3288f74efbb51.tar.xz
Switch to std mutex and condition_variable
Diffstat (limited to 'paludis/repositories/e')
-rw-r--r--paludis/repositories/e/dep_parser.cc3
-rw-r--r--paludis/repositories/e/e_choices_key.cc12
-rw-r--r--paludis/repositories/e/e_installed_repository.cc4
-rw-r--r--paludis/repositories/e/e_installed_repository_id.cc13
-rw-r--r--paludis/repositories/e/e_keywords_key.cc6
-rw-r--r--paludis/repositories/e/e_repository.cc27
-rw-r--r--paludis/repositories/e/e_slot_key.cc6
-rw-r--r--paludis/repositories/e/e_string_set_key.cc6
-rw-r--r--paludis/repositories/e/ebuild_id.cc77
-rw-r--r--paludis/repositories/e/eclass_mtimes.cc12
-rw-r--r--paludis/repositories/e/exheres_layout.cc21
-rw-r--r--paludis/repositories/e/exheres_profile.cc3
-rw-r--r--paludis/repositories/e/exndbam_id.cc3
-rw-r--r--paludis/repositories/e/exndbam_repository.cc5
-rw-r--r--paludis/repositories/e/glsa.cc3
-rw-r--r--paludis/repositories/e/info_metadata_key.cc12
-rw-r--r--paludis/repositories/e/memoised_hashes.cc5
-rw-r--r--paludis/repositories/e/metadata_xml.cc7
-rw-r--r--paludis/repositories/e/parse_dependency_label.cc9
-rw-r--r--paludis/repositories/e/parse_plain_text_label.cc3
-rw-r--r--paludis/repositories/e/parse_uri_label.cc7
-rw-r--r--paludis/repositories/e/traditional_layout.cc21
-rw-r--r--paludis/repositories/e/traditional_profile.cc8
-rw-r--r--paludis/repositories/e/vdb_repository.cc34
24 files changed, 146 insertions, 161 deletions
diff --git a/paludis/repositories/e/dep_parser.cc b/paludis/repositories/e/dep_parser.cc
index 0d1728abe..66650eeaa 100644
--- a/paludis/repositories/e/dep_parser.cc
+++ b/paludis/repositories/e/dep_parser.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2005, 2006, 2007, 2008, 2009, 2010, 2011 Ciaran McCreesh
+ * Copyright (c) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2013 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -33,7 +33,6 @@
#include <paludis/util/log.hh>
#include <paludis/util/visitor_cast.hh>
#include <paludis/util/make_null_shared_ptr.hh>
-#include <paludis/util/mutex.hh>
#include <paludis/util/singleton-impl.hh>
#include <paludis/elike_dep_parser.hh>
#include <paludis/elike_conditional_dep_spec.hh>
diff --git a/paludis/repositories/e/e_choices_key.cc b/paludis/repositories/e/e_choices_key.cc
index e250f11c1..09df36b38 100644
--- a/paludis/repositories/e/e_choices_key.cc
+++ b/paludis/repositories/e/e_choices_key.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2008, 2009, 2010, 2011 Ciaran McCreesh
+ * Copyright (c) 2008, 2009, 2010, 2011, 2013 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -28,7 +28,6 @@
#include <paludis/util/pimp-impl.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/log.hh>
-#include <paludis/util/mutex.hh>
#include <paludis/util/join.hh>
#include <paludis/util/visitor_cast.hh>
#include <paludis/util/tribool.hh>
@@ -47,10 +46,11 @@
#include <paludis/elike_choices.hh>
#include <paludis/dep_spec_annotations.hh>
-#include <list>
#include <algorithm>
-#include <set>
+#include <list>
#include <map>
+#include <mutex>
+#include <set>
using namespace paludis;
using namespace paludis::erepository;
@@ -60,7 +60,7 @@ namespace paludis
template <>
struct Imp<EChoicesKey>
{
- mutable Mutex mutex;
+ mutable std::mutex mutex;
mutable std::shared_ptr<Choices> value;
const Environment * const env;
@@ -278,7 +278,7 @@ namespace
const std::shared_ptr<const Choices>
EChoicesKey::parse_value() const
{
- Lock l(_imp->mutex);
+ std::unique_lock<std::mutex> lock(_imp->mutex);
if (_imp->value)
return _imp->value;
diff --git a/paludis/repositories/e/e_installed_repository.cc b/paludis/repositories/e/e_installed_repository.cc
index 7092794b5..2632c1951 100644
--- a/paludis/repositories/e/e_installed_repository.cc
+++ b/paludis/repositories/e/e_installed_repository.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006, 2007, 2008, 2009, 2010, 2011 Ciaran McCreesh
+ * Copyright (c) 2006, 2007, 2008, 2009, 2010, 2011, 2013 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -27,7 +27,6 @@
#include <paludis/util/visitor_cast.hh>
#include <paludis/util/pimp-impl.hh>
-#include <paludis/util/mutex.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/log.hh>
#include <paludis/util/set.hh>
@@ -67,7 +66,6 @@ namespace paludis
struct Imp<EInstalledRepository>
{
EInstalledRepositoryParams params;
- Mutex world_mutex;
Imp(const EInstalledRepositoryParams & p) :
params(p)
diff --git a/paludis/repositories/e/e_installed_repository_id.cc b/paludis/repositories/e/e_installed_repository_id.cc
index 899cb402d..8a2f9fd02 100644
--- a/paludis/repositories/e/e_installed_repository_id.cc
+++ b/paludis/repositories/e/e_installed_repository_id.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007, 2008, 2009, 2010, 2011 Ciaran McCreesh
+ * Copyright (c) 2007, 2008, 2009, 2010, 2011, 2013 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -32,7 +32,6 @@
#include <paludis/util/log.hh>
#include <paludis/util/pimp-impl.hh>
#include <paludis/util/strip.hh>
-#include <paludis/util/mutex.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/safe_ifstream.hh>
#include <paludis/util/make_named_values.hh>
@@ -145,7 +144,7 @@ namespace paludis
template <>
struct Imp<EInstalledRepositoryID>
{
- mutable Mutex mutex;
+ mutable std::recursive_mutex mutex;
const QualifiedPackageName name;
const VersionSpec version;
@@ -187,7 +186,7 @@ EInstalledRepositoryID::~EInstalledRepositoryID()
void
EInstalledRepositoryID::need_keys_added() const
{
- Lock l(_imp->mutex);
+ std::unique_lock<std::recursive_mutex> lock(_imp->mutex);
if (_imp->keys)
return;
@@ -678,7 +677,7 @@ EInstalledRepositoryID::repository_name() const
const std::shared_ptr<const EAPI>
EInstalledRepositoryID::eapi() const
{
- Lock l(_imp->mutex);
+ std::unique_lock<std::recursive_mutex> lock(_imp->mutex);
if (_imp->eapi)
return _imp->eapi;
@@ -885,7 +884,7 @@ EInstalledRepositoryID::fs_location_key() const
// Avoid loading whole metadata
if (! _imp->fs_location)
{
- Lock l(_imp->mutex);
+ std::unique_lock<std::recursive_mutex> lock(_imp->mutex);
_imp->fs_location = std::make_shared<LiteralMetadataValueKey<FSPath> >(fs_location_raw_name(),
fs_location_human_name(), mkt_internal, _imp->dir);
@@ -1089,7 +1088,7 @@ EInstalledRepositoryID::purge_invalid_cache() const
void
EInstalledRepositoryID::can_drop_in_memory_cache() const
{
- Lock l(_imp->mutex);
+ std::unique_lock<std::recursive_mutex> lock(_imp->mutex);
clear_metadata_keys();
_imp->keys.reset();
diff --git a/paludis/repositories/e/e_keywords_key.cc b/paludis/repositories/e/e_keywords_key.cc
index 07933b390..d5f0c1415 100644
--- a/paludis/repositories/e/e_keywords_key.cc
+++ b/paludis/repositories/e/e_keywords_key.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2011 Ciaran McCreesh
+ * Copyright (c) 2011, 2013 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -131,7 +131,7 @@ namespace paludis
template <>
struct Imp<EKeywordsKeyStore>
{
- mutable Mutex mutex;
+ mutable std::mutex mutex;
mutable std::unordered_map<EKeywordsKeyStoreIndex, std::shared_ptr<const EKeywordsKey>, EKeywordsKeyHash, EKeywordsKeyStoreCompare> store;
};
}
@@ -149,7 +149,7 @@ EKeywordsKeyStore::fetch(
const std::string & s,
const MetadataKeyType t) const
{
- Lock lock(_imp->mutex);
+ std::unique_lock<std::mutex> lock(_imp->mutex);
auto k(std::make_shared<Set<KeywordName> >());
tokenise_whitespace(s, create_inserter<KeywordName>(k->inserter()));
diff --git a/paludis/repositories/e/e_repository.cc b/paludis/repositories/e/e_repository.cc
index dc29c64ca..ba0e2a7ed 100644
--- a/paludis/repositories/e/e_repository.cc
+++ b/paludis/repositories/e/e_repository.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2005, 2006, 2007, 2008, 2009, 2010, 2011 Ciaran McCreesh
+ * Copyright (c) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2013 Ciaran McCreesh
* Copyright (c) 2006 Danny van Dyk
*
* This file is part of the Paludis package manager. Paludis is free software;
@@ -82,7 +82,6 @@
#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/util/make_shared_copy.hh>
#include <paludis/util/map.hh>
-#include <paludis/util/mutex.hh>
#include <paludis/util/options.hh>
#include <paludis/util/pimp-impl.hh>
#include <paludis/util/process.hh>
@@ -200,12 +199,12 @@ namespace paludis
{
struct Mutexes
{
- Mutex arch_flags_mutex;
- Mutex mirrors_mutex;
- Mutex use_desc_mutex;
- Mutex profile_ptr_mutex;
- Mutex news_ptr_mutex;
- Mutex eapi_for_file_mutex;
+ std::mutex arch_flags_mutex;
+ std::mutex mirrors_mutex;
+ std::mutex use_desc_mutex;
+ std::mutex profile_ptr_mutex;
+ std::mutex news_ptr_mutex;
+ std::mutex eapi_for_file_mutex;
};
ERepository * const repo;
@@ -421,7 +420,7 @@ namespace paludis
void
Imp<ERepository>::need_profiles() const
{
- Lock l(mutexes->profile_ptr_mutex);
+ std::unique_lock<std::mutex> l(mutexes->profile_ptr_mutex);
if (profile_ptr)
return;
@@ -633,7 +632,7 @@ ERepository::package_ids(const QualifiedPackageName & n, const RepositoryContent
const std::shared_ptr<const Set<UnprefixedChoiceName> >
ERepository::arch_flags() const
{
- Lock l(_imp->mutexes->arch_flags_mutex);
+ std::unique_lock<std::mutex> l(_imp->mutexes->arch_flags_mutex);
if (! _imp->arch_flags)
{
Context context("When loading arch list:");
@@ -679,7 +678,7 @@ namespace
void
ERepository::need_mirrors() const
{
- Lock l(_imp->mutexes->mirrors_mutex);
+ std::unique_lock<std::mutex> l(_imp->mutexes->mirrors_mutex);
if (! _imp->has_mirrors)
{
@@ -850,7 +849,7 @@ ERepository::purge_invalid_cache() const
void
ERepository::update_news() const
{
- Lock l(_imp->mutexes->news_ptr_mutex);
+ std::unique_lock<std::mutex> l(_imp->mutexes->news_ptr_mutex);
if (! _imp->news_ptr)
_imp->news_ptr = std::make_shared<ERepositoryNews>(_imp->params.environment(), this, _imp->params);
@@ -1594,7 +1593,7 @@ ERepository::repository_factory_dependencies(
const std::shared_ptr<const UseDesc>
ERepository::use_desc() const
{
- Lock l(_imp->mutexes->use_desc_mutex);
+ std::unique_lock<std::mutex> l(_imp->mutexes->use_desc_mutex);
if (! _imp->use_desc)
{
_imp->use_desc = std::make_shared<UseDesc>(_imp->layout->use_desc_files());
@@ -1607,7 +1606,7 @@ const std::string
ERepository::eapi_for_file(const FSPath & f) const
{
FSPath dir(f.dirname());
- Lock lock(_imp->mutexes->eapi_for_file_mutex);
+ std::unique_lock<std::mutex> lock(_imp->mutexes->eapi_for_file_mutex);
EAPIForFileMap::const_iterator i(_imp->eapi_for_file_map.find(dir));
if (i == _imp->eapi_for_file_map.end())
{
diff --git a/paludis/repositories/e/e_slot_key.cc b/paludis/repositories/e/e_slot_key.cc
index f97fb22d4..4ecdbae03 100644
--- a/paludis/repositories/e/e_slot_key.cc
+++ b/paludis/repositories/e/e_slot_key.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2010, 2011, 2012 Ciaran McCreesh
+ * Copyright (c) 2010, 2011, 2012, 2013 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -97,7 +97,7 @@ namespace paludis
template <>
struct Imp<ESlotKeyStore>
{
- mutable Mutex mutex;
+ mutable std::mutex mutex;
mutable std::unordered_map<ESlotKeyStoreIndex, std::shared_ptr<const ESlotKey>, ESlotKeyStoreHash> store;
};
}
@@ -127,7 +127,7 @@ ESlotKeyStore::fetch(
}
}
- Lock lock(_imp->mutex);
+ std::unique_lock<std::mutex> lock(_imp->mutex);
ESlotKeyStoreIndex x(v, ss, mkt);
auto i(_imp->store.find(x));
diff --git a/paludis/repositories/e/e_string_set_key.cc b/paludis/repositories/e/e_string_set_key.cc
index b2cde9a24..0252666e0 100644
--- a/paludis/repositories/e/e_string_set_key.cc
+++ b/paludis/repositories/e/e_string_set_key.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2011 Ciaran McCreesh
+ * Copyright (c) 2011, 2013 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -130,7 +130,7 @@ namespace paludis
template <>
struct Imp<EStringSetKeyStore>
{
- mutable Mutex mutex;
+ mutable std::mutex mutex;
mutable std::unordered_map<EStringSetKeyStoreIndex, std::shared_ptr<const EStringSetKey>, EStringSetKeyHash, EStringSetKeyStoreCompare> store;
};
}
@@ -148,7 +148,7 @@ EStringSetKeyStore::fetch(
const std::string & s,
const MetadataKeyType t) const
{
- Lock lock(_imp->mutex);
+ std::unique_lock<std::mutex> lock(_imp->mutex);
auto k(std::make_shared<Set<std::string> >());
tokenise_whitespace(s, k->inserter());
diff --git a/paludis/repositories/e/ebuild_id.cc b/paludis/repositories/e/ebuild_id.cc
index 51781cc59..cdc8f8088 100644
--- a/paludis/repositories/e/ebuild_id.cc
+++ b/paludis/repositories/e/ebuild_id.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007, 2008, 2009, 2010, 2011 Ciaran McCreesh
+ * Copyright (c) 2007, 2008, 2009, 2010, 2011, 2013 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -54,7 +54,6 @@
#include <paludis/util/fs_error.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/log.hh>
-#include <paludis/util/mutex.hh>
#include <paludis/util/pimp-impl.hh>
#include <paludis/util/save.hh>
#include <paludis/util/make_named_values.hh>
@@ -135,7 +134,7 @@ namespace paludis
template <>
struct Imp<EbuildID>
{
- mutable Mutex mutex;
+ mutable std::recursive_mutex mutex;
const QualifiedPackageName name;
const VersionSpec version;
@@ -230,7 +229,7 @@ EbuildID::~EbuildID()
void
EbuildID::need_non_xml_keys_added() const
{
- Lock l(_imp->mutex);
+ std::unique_lock<std::recursive_mutex> lock(_imp->mutex);
if (_imp->has_non_xml_keys)
return;
@@ -499,7 +498,7 @@ EbuildID::presource_eapi() const
void
EbuildID::need_xml_keys_added() const
{
- Lock l(_imp->mutex);
+ std::unique_lock<std::recursive_mutex> lock(_imp->mutex);
if (_imp->has_xml_keys)
return;
@@ -530,7 +529,7 @@ EbuildID::need_xml_keys_added() const
void
EbuildID::need_keys_added() const
{
- Lock l(_imp->mutex);
+ std::unique_lock<std::recursive_mutex> lock(_imp->mutex);
need_non_xml_keys_added();
need_xml_keys_added();
@@ -619,7 +618,7 @@ namespace
void
EbuildID::need_masks_added() const
{
- Lock l(_imp->mutex);
+ std::unique_lock<std::recursive_mutex> lock(_imp->mutex);
if (_imp->has_masks)
return;
@@ -996,7 +995,7 @@ EbuildID::extra_hash_value() const
void
EbuildID::set_eapi(const std::string & s) const
{
- Lock l(_imp->mutex);
+ std::unique_lock<std::recursive_mutex> lock(_imp->mutex);
_imp->eapi = EAPIData::get_instance()->eapi_from_string(s);
}
@@ -1009,7 +1008,7 @@ EbuildID::guessed_eapi_name() const
void
EbuildID::load_captured_stderr(const std::string & r, const std::string & h, const MetadataKeyType t, const std::string & v) const
{
- Lock l(_imp->mutex);
+ std::unique_lock<std::recursive_mutex> lock(_imp->mutex);
_imp->captured_stderr_key = std::make_shared<LiteralMetadataValueKey<std::string> >(r, h, t, v);
add_metadata_key(_imp->captured_stderr_key);
}
@@ -1017,7 +1016,7 @@ EbuildID::load_captured_stderr(const std::string & r, const std::string & h, con
void
EbuildID::load_captured_stdout(const std::string & r, const std::string & h, const MetadataKeyType t, const std::string & v) const
{
- Lock l(_imp->mutex);
+ std::unique_lock<std::recursive_mutex> lock(_imp->mutex);
_imp->captured_stdout_key = std::make_shared<LiteralMetadataValueKey<std::string> >(r, h, t, v);
add_metadata_key(_imp->captured_stdout_key);
}
@@ -1025,7 +1024,7 @@ EbuildID::load_captured_stdout(const std::string & r, const std::string & h, con
void
EbuildID::load_short_description(const std::string & r, const std::string & h, const std::string & v) const
{
- Lock l(_imp->mutex);
+ std::unique_lock<std::recursive_mutex> lock(_imp->mutex);
_imp->short_description = std::make_shared<LiteralMetadataValueKey<std::string> >(r, h, mkt_significant, v);
add_metadata_key(_imp->short_description);
}
@@ -1033,7 +1032,7 @@ EbuildID::load_short_description(const std::string & r, const std::string & h, c
void
EbuildID::load_long_description(const std::string & r, const std::string & h, const std::string & v) const
{
- Lock l(_imp->mutex);
+ std::unique_lock<std::recursive_mutex> lock(_imp->mutex);
_imp->long_description = std::make_shared<LiteralMetadataValueKey<std::string> >(r, h, mkt_normal, v);
add_metadata_key(_imp->long_description);
}
@@ -1043,7 +1042,7 @@ EbuildID::load_dependencies(const std::string & r, const std::string & h, const
{
if (! strip_leading(v, " \t\r\n").empty())
{
- Lock l(_imp->mutex);
+ std::unique_lock<std::recursive_mutex> lock(_imp->mutex);
_imp->dependencies = std::make_shared<EDependenciesKey>(_imp->environment, shared_from_this(), r, h, v,
EbuildIDData::get_instance()->raw_dependencies_labels, mkt_dependencies);
add_metadata_key(_imp->dependencies);
@@ -1056,7 +1055,7 @@ EbuildID::load_build_depend(const std::string & r, const std::string & h, const
{
if (! strip_leading(v, " \t\r\n").empty())
{
- Lock l(_imp->mutex);
+ std::unique_lock<std::recursive_mutex> lock(_imp->mutex);
_imp->build_dependencies = std::make_shared<EDependenciesKey>(_imp->environment, shared_from_this(), r, h, v,
EbuildIDData::get_instance()->build_dependencies_labels, rewritten ? mkt_internal : mkt_dependencies);
add_metadata_key(_imp->build_dependencies);
@@ -1069,7 +1068,7 @@ EbuildID::load_run_depend(const std::string & r, const std::string & h, const st
{
if (! strip_leading(v, " \t\r\n").empty())
{
- Lock l(_imp->mutex);
+ std::unique_lock<std::recursive_mutex> lock(_imp->mutex);
_imp->run_dependencies = std::make_shared<EDependenciesKey>(_imp->environment, shared_from_this(), r, h, v,
EbuildIDData::get_instance()->run_dependencies_labels, rewritten ? mkt_internal : mkt_dependencies);
add_metadata_key(_imp->run_dependencies);
@@ -1082,7 +1081,7 @@ EbuildID::load_post_depend(const std::string & r, const std::string & h, const s
{
if (! strip_leading(v, " \t\r\n").empty())
{
- Lock l(_imp->mutex);
+ std::unique_lock<std::recursive_mutex> lock(_imp->mutex);
_imp->post_dependencies = std::make_shared<EDependenciesKey>(_imp->environment, shared_from_this(), r, h, v,
EbuildIDData::get_instance()->post_dependencies_labels, rewritten ? mkt_internal : mkt_dependencies);
add_metadata_key(_imp->post_dependencies);
@@ -1092,7 +1091,7 @@ EbuildID::load_post_depend(const std::string & r, const std::string & h, const s
void
EbuildID::load_src_uri(const std::shared_ptr<const EAPIMetadataVariable> & m, const std::string & v) const
{
- Lock l(_imp->mutex);
+ std::unique_lock<std::recursive_mutex> lock(_imp->mutex);
_imp->src_uri = std::make_shared<EFetchableURIKey>(_imp->environment, shared_from_this(), m, v, mkt_dependencies);
add_metadata_key(_imp->src_uri);
}
@@ -1100,7 +1099,7 @@ EbuildID::load_src_uri(const std::shared_ptr<const EAPIMetadataVariable> & m, co
void
EbuildID::load_homepage(const std::shared_ptr<const EAPIMetadataVariable> & m, const std::string & v) const
{
- Lock l(_imp->mutex);
+ std::unique_lock<std::recursive_mutex> lock(_imp->mutex);
_imp->homepage = std::make_shared<ESimpleURIKey>(_imp->environment, m, eapi(), v, mkt_significant, is_installed());
add_metadata_key(_imp->homepage);
}
@@ -1108,7 +1107,7 @@ EbuildID::load_homepage(const std::shared_ptr<const EAPIMetadataVariable> & m, c
void
EbuildID::load_license(const std::shared_ptr<const EAPIMetadataVariable> & m, const std::string & v) const
{
- Lock l(_imp->mutex);
+ std::unique_lock<std::recursive_mutex> lock(_imp->mutex);
_imp->license = std::make_shared<ELicenseKey>(_imp->environment, m, eapi(), v, mkt_internal, is_installed());
add_metadata_key(_imp->license);
}
@@ -1118,7 +1117,7 @@ EbuildID::load_restrict(const std::shared_ptr<const EAPIMetadataVariable> & m, c
{
if (! strip_leading(v, " \t\r\n").empty())
{
- Lock l(_imp->mutex);
+ std::unique_lock<std::recursive_mutex> lock(_imp->mutex);
_imp->restrictions = std::make_shared<EPlainTextSpecKey>(_imp->environment, m, eapi(), v, mkt_internal, is_installed());
add_metadata_key(_imp->restrictions);
}
@@ -1129,7 +1128,7 @@ EbuildID::load_properties(const std::shared_ptr<const EAPIMetadataVariable> & m,
{
if (! strip_leading(v, " \t\r\n").empty())
{
- Lock l(_imp->mutex);
+ std::unique_lock<std::recursive_mutex> lock(_imp->mutex);
_imp->properties = std::make_shared<EPlainTextSpecKey>(_imp->environment, m, eapi(), v, mkt_internal, is_installed());
add_metadata_key(_imp->properties);
}
@@ -1138,7 +1137,7 @@ EbuildID::load_properties(const std::shared_ptr<const EAPIMetadataVariable> & m,
void
EbuildID::load_iuse(const std::shared_ptr<const EAPIMetadataVariable> & k, const std::string & v) const
{
- Lock l(_imp->mutex);
+ std::unique_lock<std::recursive_mutex> lock(_imp->mutex);
_imp->raw_iuse = EStringSetKeyStore::get_instance()->fetch(k, v, mkt_internal);
add_metadata_key(_imp->raw_iuse);
}
@@ -1146,7 +1145,7 @@ EbuildID::load_iuse(const std::shared_ptr<const EAPIMetadataVariable> & k, const
void
EbuildID::load_myoptions(const std::shared_ptr<const EAPIMetadataVariable> & h, const std::string & v) const
{
- Lock l(_imp->mutex);
+ std::unique_lock<std::recursive_mutex> lock(_imp->mutex);
_imp->raw_myoptions = std::make_shared<EMyOptionsKey>(_imp->environment, h, eapi(), v, mkt_internal, is_installed());
add_metadata_key(_imp->raw_myoptions);
}
@@ -1156,7 +1155,7 @@ EbuildID::load_required_use(const std::shared_ptr<const EAPIMetadataVariable> &
{
if (! strip_leading(v, " \t\r\n").empty())
{
- Lock l(_imp->mutex);
+ std::unique_lock<std::recursive_mutex> lock(_imp->mutex);
_imp->required_use = std::make_shared<ERequiredUseKey>(_imp->environment, k, eapi(), v, mkt_internal, is_installed());
add_metadata_key(_imp->required_use);
}
@@ -1165,7 +1164,7 @@ EbuildID::load_required_use(const std::shared_ptr<const EAPIMetadataVariable> &
void
EbuildID::load_use(const std::shared_ptr<const EAPIMetadataVariable> & r, const std::string & v) const
{
- Lock l(_imp->mutex);
+ std::unique_lock<std::recursive_mutex> lock(_imp->mutex);
_imp->raw_use = EStringSetKeyStore::get_instance()->fetch(r, v, mkt_internal);
add_metadata_key(_imp->raw_use);
}
@@ -1173,7 +1172,7 @@ EbuildID::load_use(const std::shared_ptr<const EAPIMetadataVariable> & r, const
void
EbuildID::load_keywords(const std::shared_ptr<const EAPIMetadataVariable> & h, const std::string & v) const
{
- Lock l(_imp->mutex);
+ std::unique_lock<std::recursive_mutex> lock(_imp->mutex);
_imp->keywords = EKeywordsKeyStore::get_instance()->fetch(h, v, mkt_internal);
add_metadata_key(_imp->keywords);
}
@@ -1181,7 +1180,7 @@ EbuildID::load_keywords(const std::shared_ptr<const EAPIMetadataVariable> & h, c
void
EbuildID::load_inherited(const std::shared_ptr<const EAPIMetadataVariable> & r, const std::string & v) const
{
- Lock l(_imp->mutex);
+ std::unique_lock<std::recursive_mutex> lock(_imp->mutex);
_imp->inherited = EStringSetKeyStore::get_instance()->fetch(r, v, mkt_internal);
add_metadata_key(_imp->inherited);
}
@@ -1192,7 +1191,7 @@ EbuildID::load_defined_phases(const std::shared_ptr<const EAPIMetadataVariable>
if (strip_leading(v, " \t\r\n").empty())
throw InternalError(PALUDIS_HERE, "v should not be empty");
- Lock l(_imp->mutex);
+ std::unique_lock<std::recursive_mutex> lock(_imp->mutex);
_imp->defined_phases = EStringSetKeyStore::get_instance()->fetch(h, v, mkt_internal);
add_metadata_key(_imp->defined_phases);
}
@@ -1200,7 +1199,7 @@ EbuildID::load_defined_phases(const std::shared_ptr<const EAPIMetadataVariable>
void
EbuildID::load_upstream_changelog(const std::shared_ptr<const EAPIMetadataVariable> & m, const std::string & v) const
{
- Lock l(_imp->mutex);
+ std::unique_lock<std::recursive_mutex> lock(_imp->mutex);
_imp->upstream_changelog = std::make_shared<ESimpleURIKey>(_imp->environment, m, eapi(), v, mkt_normal, is_installed());
add_metadata_key(_imp->upstream_changelog);
}
@@ -1208,7 +1207,7 @@ EbuildID::load_upstream_changelog(const std::shared_ptr<const EAPIMetadataVariab
void
EbuildID::load_upstream_documentation(const std::shared_ptr<const EAPIMetadataVariable> & m, const std::string & v) const
{
- Lock l(_imp->mutex);
+ std::unique_lock<std::recursive_mutex> lock(_imp->mutex);
_imp->upstream_documentation = std::make_shared<ESimpleURIKey>(_imp->environment, m, eapi(), v, mkt_normal, is_installed());
add_metadata_key(_imp->upstream_documentation);
}
@@ -1216,7 +1215,7 @@ EbuildID::load_upstream_documentation(const std::shared_ptr<const EAPIMetadataVa
void
EbuildID::load_upstream_release_notes(const std::shared_ptr<const EAPIMetadataVariable> & m, const std::string & v) const
{
- Lock l(_imp->mutex);
+ std::unique_lock<std::recursive_mutex> lock(_imp->mutex);
_imp->upstream_release_notes = std::make_shared<ESimpleURIKey>(_imp->environment, m, eapi(), v, mkt_normal, is_installed());
add_metadata_key(_imp->upstream_release_notes);
}
@@ -1224,7 +1223,7 @@ EbuildID::load_upstream_release_notes(const std::shared_ptr<const EAPIMetadataVa
void
EbuildID::load_bugs_to(const std::shared_ptr<const EAPIMetadataVariable> & m, const std::string & v) const
{
- Lock l(_imp->mutex);
+ std::unique_lock<std::recursive_mutex> lock(_imp->mutex);
_imp->bugs_to = std::make_shared<EPlainTextSpecKey>(_imp->environment, m, eapi(), v, mkt_normal, is_installed());
add_metadata_key(_imp->bugs_to);
}
@@ -1232,7 +1231,7 @@ EbuildID::load_bugs_to(const std::shared_ptr<const EAPIMetadataVariable> & m, co
void
EbuildID::load_remote_ids(const std::shared_ptr<const EAPIMetadataVariable> & m, const std::string & v) const
{
- Lock l(_imp->mutex);
+ std::unique_lock<std::recursive_mutex> lock(_imp->mutex);
_imp->remote_ids = std::make_shared<EPlainTextSpecKey>(_imp->environment, m, eapi(), v, mkt_internal, is_installed());
add_metadata_key(_imp->remote_ids);
}
@@ -1240,7 +1239,7 @@ EbuildID::load_remote_ids(const std::shared_ptr<const EAPIMetadataVariable> & m,
void
EbuildID::load_slot(const std::shared_ptr<const EAPIMetadataVariable> & m, const std::string & v) const
{
- Lock l(_imp->mutex);
+ std::unique_lock<std::recursive_mutex> lock(_imp->mutex);
_imp->slot = ESlotKeyStore::get_instance()->fetch(*eapi(), m, v, mkt_internal);
add_metadata_key(_imp->slot);
}
@@ -1248,7 +1247,7 @@ EbuildID::load_slot(const std::shared_ptr<const EAPIMetadataVariable> & m, const
void
EbuildID::load_generated_from(const std::shared_ptr<const EAPIMetadataVariable> & h, const std::string & v) const
{
- Lock l(_imp->mutex);
+ std::unique_lock<std::recursive_mutex> lock(_imp->mutex);
_imp->generated_from = EStringSetKeyStore::get_instance()->fetch(h, v, mkt_normal);
add_metadata_key(_imp->generated_from);
}
@@ -1256,7 +1255,7 @@ EbuildID::load_generated_from(const std::shared_ptr<const EAPIMetadataVariable>
void
EbuildID::load_generated_time(const std::string & r, const std::string & h, const std::string & v) const
{
- Lock l(_imp->mutex);
+ std::unique_lock<std::recursive_mutex> lock(_imp->mutex);
_imp->generated_time = std::make_shared<LiteralMetadataTimeKey>(r, h, mkt_normal, Timestamp(destringify<std::time_t>(v), 0));
add_metadata_key(_imp->generated_time);
}
@@ -1264,7 +1263,7 @@ EbuildID::load_generated_time(const std::string & r, const std::string & h, cons
void
EbuildID::load_generated_using(const std::string & r, const std::string & h, const std::string & v) const
{
- Lock l(_imp->mutex);
+ std::unique_lock<std::recursive_mutex> lock(_imp->mutex);
_imp->generated_using = std::make_shared<LiteralMetadataValueKey<std::string> >(r, h, mkt_normal, v);
add_metadata_key(_imp->generated_using);
}
@@ -1272,7 +1271,7 @@ EbuildID::load_generated_using(const std::string & r, const std::string & h, con
void
EbuildID::load_scm_revision(const std::string & r, const std::string & h, const std::string & v) const
{
- Lock l(_imp->mutex);
+ std::unique_lock<std::recursive_mutex> lock(_imp->mutex);
_imp->scm_revision = std::make_shared<LiteralMetadataValueKey<std::string> >(r, h, mkt_normal, v);
add_metadata_key(_imp->scm_revision);
}
@@ -1785,7 +1784,7 @@ EbuildID::is_installed() const
void
EbuildID::set_scm_revision(const std::string & s) const
{
- Lock l(_imp->mutex);
+ std::unique_lock<std::recursive_mutex> lock(_imp->mutex);
if ((! eapi()->supported()) ||
eapi()->supported()->ebuild_metadata_variables()->scm_revision()->name().empty() ||
diff --git a/paludis/repositories/e/eclass_mtimes.cc b/paludis/repositories/e/eclass_mtimes.cc
index c2474769a..2ce163f98 100644
--- a/paludis/repositories/e/eclass_mtimes.cc
+++ b/paludis/repositories/e/eclass_mtimes.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006, 2007, 2008, 2010, 2011 Ciaran McCreesh
+ * Copyright (c) 2006, 2007, 2008, 2010, 2011, 2013 Ciaran McCreesh
* Copyright (c) 2008, 2012 David Leverton
*
* This file is part of the Paludis package manager. Paludis is free software;
@@ -24,12 +24,12 @@
#include <paludis/name.hh>
#include <paludis/util/pimp-impl.hh>
#include <paludis/util/sequence.hh>
-#include <paludis/util/mutex.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/hashes.hh>
#include <paludis/util/fs_stat.hh>
#include <paludis/util/md5.hh>
#include <paludis/util/safe_ifstream.hh>
+#include <mutex>
#include <unordered_map>
using namespace paludis;
@@ -77,7 +77,7 @@ namespace paludis
mutable Cache eclasses;
mutable std::unordered_map<QualifiedPackageName, Cache, Hash<QualifiedPackageName> > exlibs;
mutable MD5Map md5s;
- mutable Mutex mutex;
+ mutable std::mutex mutex;
Imp(const ERepository * r, const std::shared_ptr<const FSPathSequence> & d) :
repo(r),
@@ -99,14 +99,14 @@ EclassMtimes::~EclassMtimes()
const std::pair<FSPath, FSStat> *
EclassMtimes::eclass(const std::string & e) const
{
- Lock l(_imp->mutex);
+ std::unique_lock<std::mutex> lock(_imp->mutex);
return lookup(e + ".eclass", _imp->eclasses);
}
const std::pair<FSPath, FSStat> *
EclassMtimes::exlib(const std::string & e, const QualifiedPackageName & qpn) const
{
- Lock l(_imp->mutex);
+ std::unique_lock<std::mutex> lock(_imp->mutex);
std::unordered_map<QualifiedPackageName, Cache, Hash<QualifiedPackageName> >::iterator cache(_imp->exlibs.find(qpn));
if (_imp->exlibs.end() == cache)
cache = _imp->exlibs.insert(std::make_pair(qpn, Cache(_imp->repo->layout()->exlibsdirs(qpn)))).first;
@@ -116,7 +116,7 @@ EclassMtimes::exlib(const std::string & e, const QualifiedPackageName & qpn) con
std::string
EclassMtimes::md5(const FSPath & p) const
{
- Lock l(_imp->mutex);
+ std::unique_lock<std::mutex> lock(_imp->mutex);
MD5Map::const_iterator it(_imp->md5s.find(p));
if (_imp->md5s.end() != it)
return it->second;
diff --git a/paludis/repositories/e/exheres_layout.cc b/paludis/repositories/e/exheres_layout.cc
index 7891ce504..4be51e146 100644
--- a/paludis/repositories/e/exheres_layout.cc
+++ b/paludis/repositories/e/exheres_layout.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007, 2008, 2009, 2010, 2011 Ciaran McCreesh
+ * Copyright (c) 2007, 2008, 2009, 2010, 2011, 2013 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -30,7 +30,6 @@
#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/log.hh>
#include <paludis/util/map.hh>
-#include <paludis/util/mutex.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/is_file_with_extension.hh>
#include <paludis/util/wrapped_output_iterator.hh>
@@ -79,7 +78,7 @@ namespace paludis
const ERepository * const repository;
const FSPath tree_root;
- mutable Mutex big_nasty_mutex;
+ mutable std::recursive_mutex big_nasty_mutex;
mutable bool has_category_names;
mutable CategoryMap category_names;
@@ -190,7 +189,7 @@ ExheresLayout::categories_file() const
void
ExheresLayout::need_category_names() const
{
- Lock l(_imp->big_nasty_mutex);
+ std::unique_lock<std::recursive_mutex> lock(_imp->big_nasty_mutex);
if (_imp->has_category_names)
return;
@@ -240,7 +239,7 @@ ExheresLayout::need_category_names() const
void
ExheresLayout::need_package_ids(const QualifiedPackageName & n) const
{
- Lock l(_imp->big_nasty_mutex);
+ std::unique_lock<std::recursive_mutex> lock(_imp->big_nasty_mutex);
using namespace std::placeholders;
@@ -290,7 +289,7 @@ ExheresLayout::need_package_ids(const QualifiedPackageName & n) const
bool
ExheresLayout::has_category_named(const CategoryNamePart & c) const
{
- Lock l(_imp->big_nasty_mutex);
+ std::unique_lock<std::recursive_mutex> lock(_imp->big_nasty_mutex);
Context context("When checking for category '" + stringify(c) + "' in '" + stringify(_imp->repository->name()) + "':");
@@ -301,7 +300,7 @@ ExheresLayout::has_category_named(const CategoryNamePart & c) const
bool
ExheresLayout::has_package_named(const QualifiedPackageName & q) const
{
- Lock l(_imp->big_nasty_mutex);
+ std::unique_lock<std::recursive_mutex> lock(_imp->big_nasty_mutex);
Context context("When checking for package '" + stringify(q) + "' in '" + stringify(_imp->repository->name()) + ":");
@@ -337,7 +336,7 @@ ExheresLayout::has_package_named(const QualifiedPackageName & q) const
void
ExheresLayout::need_category_names_collection() const
{
- Lock l(_imp->big_nasty_mutex);
+ std::unique_lock<std::recursive_mutex> lock(_imp->big_nasty_mutex);
if (_imp->category_names_collection)
return;
@@ -353,7 +352,7 @@ ExheresLayout::need_category_names_collection() const
std::shared_ptr<const CategoryNamePartSet>
ExheresLayout::category_names() const
{
- Lock l(_imp->big_nasty_mutex);
+ std::unique_lock<std::recursive_mutex> lock(_imp->big_nasty_mutex);
Context context("When fetching category names in " + stringify(stringify(_imp->repository->name())) + ":");
@@ -364,7 +363,7 @@ ExheresLayout::category_names() const
std::shared_ptr<const QualifiedPackageNameSet>
ExheresLayout::package_names(const CategoryNamePart & c) const
{
- Lock l(_imp->big_nasty_mutex);
+ std::unique_lock<std::recursive_mutex> lock(_imp->big_nasty_mutex);
using namespace std::placeholders;
@@ -414,7 +413,7 @@ ExheresLayout::package_names(const CategoryNamePart & c) const
std::shared_ptr<const PackageIDSequence>
ExheresLayout::package_ids(const QualifiedPackageName & n) const
{
- Lock l(_imp->big_nasty_mutex);
+ std::unique_lock<std::recursive_mutex> lock(_imp->big_nasty_mutex);
Context context("When fetching versions of '" + stringify(n) + "' in " + stringify(_imp->repository->name()) + ":");
diff --git a/paludis/repositories/e/exheres_profile.cc b/paludis/repositories/e/exheres_profile.cc
index 67d23c0f9..de84491a7 100644
--- a/paludis/repositories/e/exheres_profile.cc
+++ b/paludis/repositories/e/exheres_profile.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2005, 2006, 2007, 2008, 2009, 2010, 2011 Ciaran McCreesh
+ * Copyright (c) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2013 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -30,7 +30,6 @@
#include <paludis/util/wrapped_output_iterator.hh>
#include <paludis/util/config_file.hh>
#include <paludis/util/map.hh>
-#include <paludis/util/mutex.hh>
#include <paludis/util/set.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/hashes.hh>
diff --git a/paludis/repositories/e/exndbam_id.cc b/paludis/repositories/e/exndbam_id.cc
index ab2b651c7..7cc85065c 100644
--- a/paludis/repositories/e/exndbam_id.cc
+++ b/paludis/repositories/e/exndbam_id.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2008, 2009, 2010, 2011 Ciaran McCreesh
+ * Copyright (c) 2008, 2009, 2010, 2011, 2013 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -18,7 +18,6 @@
*/
#include <paludis/repositories/e/exndbam_id.hh>
-#include <paludis/util/mutex.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/set.hh>
#include <paludis/util/sequence.hh>
diff --git a/paludis/repositories/e/exndbam_repository.cc b/paludis/repositories/e/exndbam_repository.cc
index d3c76436e..7064b2f95 100644
--- a/paludis/repositories/e/exndbam_repository.cc
+++ b/paludis/repositories/e/exndbam_repository.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2008, 2009, 2010, 2011 Ciaran McCreesh
+ * Copyright (c) 2008, 2009, 2010, 2011, 2013 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -54,6 +54,7 @@
#include <paludis/slot.hh>
#include <functional>
+#include <mutex>
using namespace paludis;
using namespace paludis::erepository;
@@ -212,7 +213,7 @@ ExndbamRepository::package_ids(const QualifiedPackageName & q,
for (IndirectIterator<NDBAMEntrySequence::ConstIterator> e(entries->begin()), e_end(entries->end()) ;
e != e_end ; ++e)
{
- Lock l(*(*e).mutex());
+ std::unique_lock<std::mutex> l(*(*e).mutex());
if (! (*e).package_id())
(*e).package_id() = std::make_shared<ExndbamID>((*e).name(), (*e).version(), _imp->params.environment(),
name(), (*e).fs_location(), &_imp->ndbam);
diff --git a/paludis/repositories/e/glsa.cc b/paludis/repositories/e/glsa.cc
index c9a883c05..ce904ed58 100644
--- a/paludis/repositories/e/glsa.cc
+++ b/paludis/repositories/e/glsa.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006, 2007, 2008, 2009, 2010, 2011 Ciaran McCreesh
+ * Copyright (c) 2006, 2007, 2008, 2009, 2010, 2011, 2013 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -21,7 +21,6 @@
#include <paludis/repositories/e/xml_things_handle.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/pimp-impl.hh>
-#include <paludis/util/mutex.hh>
#include <paludis/util/wrapped_forward_iterator-impl.hh>
#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/about.hh>
diff --git a/paludis/repositories/e/info_metadata_key.cc b/paludis/repositories/e/info_metadata_key.cc
index 6b1be734f..f90ad2585 100644
--- a/paludis/repositories/e/info_metadata_key.cc
+++ b/paludis/repositories/e/info_metadata_key.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2008, 2009, 2010, 2011 Ciaran McCreesh
+ * Copyright (c) 2008, 2009, 2010, 2011, 2013 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -22,7 +22,6 @@
#include <paludis/repositories/e/e_repository.hh>
#include <paludis/util/pimp-impl.hh>
-#include <paludis/util/mutex.hh>
#include <paludis/util/config_file.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/options.hh>
@@ -48,6 +47,7 @@
#include <map>
#include <algorithm>
#include <functional>
+#include <mutex>
using namespace paludis;
using namespace paludis::erepository;
@@ -59,7 +59,7 @@ namespace paludis
{
const std::shared_ptr<const FSPathSequence> locations;
- mutable Mutex mutex;
+ mutable std::mutex mutex;
mutable std::shared_ptr<Set<std::string> > value;
Imp(const std::shared_ptr<const FSPathSequence> & l) :
@@ -75,7 +75,7 @@ namespace paludis
const std::shared_ptr<const FSPathSequence> locations;
const ERepository * const e_repository;
- mutable Mutex mutex;
+ mutable std::mutex mutex;
mutable bool added;
Imp(const Environment * const e, const std::shared_ptr<const FSPathSequence> & l,
@@ -101,7 +101,7 @@ InfoVarsMetadataKey::~InfoVarsMetadataKey()
const std::shared_ptr<const Set<std::string> >
InfoVarsMetadataKey::parse_value() const
{
- Lock l(_imp->mutex);
+ std::unique_lock<std::mutex> lock(_imp->mutex);
if (_imp->value)
return _imp->value;
@@ -156,7 +156,7 @@ InfoPkgsMetadataKey::~InfoPkgsMetadataKey()
void
InfoPkgsMetadataKey::need_keys_added() const
{
- Lock l(_imp->mutex);
+ std::unique_lock<std::mutex> lock(_imp->mutex);
if (_imp->added)
return;
diff --git a/paludis/repositories/e/memoised_hashes.cc b/paludis/repositories/e/memoised_hashes.cc
index a72c88fd7..290790856 100644
--- a/paludis/repositories/e/memoised_hashes.cc
+++ b/paludis/repositories/e/memoised_hashes.cc
@@ -19,7 +19,6 @@
#include <paludis/repositories/e/memoised_hashes.hh>
-#include <paludis/util/mutex.hh>
#include <paludis/util/pimp-impl.hh>
#include <paludis/util/singleton-impl.hh>
#include <paludis/util/safe_ifstream.hh>
@@ -40,7 +39,7 @@ namespace paludis
template <>
struct Imp<MemoisedHashes>
{
- mutable Mutex mutex;
+ mutable std::mutex mutex;
mutable HashesMap hashes;
Imp()
@@ -64,7 +63,7 @@ MemoisedHashes::get(const std::string & algo, const FSPath & file, SafeIFStream
std::pair<std::string, std::string> key(stringify(file), algo);
Timestamp mtime(file.stat().mtim());
- Lock l(_imp->mutex);
+ std::unique_lock<std::mutex> lock(_imp->mutex);
HashesMap::iterator i(_imp->hashes.find(key));
diff --git a/paludis/repositories/e/metadata_xml.cc b/paludis/repositories/e/metadata_xml.cc
index 73d22ba63..216ab0a35 100644
--- a/paludis/repositories/e/metadata_xml.cc
+++ b/paludis/repositories/e/metadata_xml.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2008, 2010, 2011 Ciaran McCreesh
+ * Copyright (c) 2008, 2010, 2011, 2013 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -22,7 +22,6 @@
#include <paludis/util/pimp-impl.hh>
#include <paludis/util/singleton-impl.hh>
#include <paludis/util/map-impl.hh>
-#include <paludis/util/mutex.hh>
#include <paludis/util/hashes.hh>
#include <paludis/util/log.hh>
#include <paludis/util/fs_path.hh>
@@ -41,7 +40,7 @@ namespace paludis
template <>
struct Imp<MetadataXMLPool>
{
- mutable Mutex mutex;
+ mutable std::mutex mutex;
mutable Store store;
};
}
@@ -61,7 +60,7 @@ MetadataXMLPool::metadata_if_exists(const FSPath & f) const
Context context("When handling metadata.xml file '" + stringify(f) + "':");
FSPath f_real(f.realpath_if_exists());
- Lock lock(_imp->mutex);
+ std::unique_lock<std::mutex> lock(_imp->mutex);
Store::const_iterator i(_imp->store.find(f_real));
if (i != _imp->store.end())
return i->second;
diff --git a/paludis/repositories/e/parse_dependency_label.cc b/paludis/repositories/e/parse_dependency_label.cc
index 6ab886654..9f4588858 100644
--- a/paludis/repositories/e/parse_dependency_label.cc
+++ b/paludis/repositories/e/parse_dependency_label.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2005, 2006, 2007, 2008, 2009, 2010, 2011 Ciaran McCreesh
+ * Copyright (c) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2013 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -22,7 +22,6 @@
#include <paludis/repositories/e/eapi.hh>
#include <paludis/util/log.hh>
-#include <paludis/util/mutex.hh>
#include <paludis/util/tokeniser.hh>
#include <paludis/util/singleton-impl.hh>
@@ -99,7 +98,7 @@ namespace
struct DepLabelsStore :
Singleton<DepLabelsStore>
{
- Mutex mutex;
+ std::mutex mutex;
std::map<DepLabelsIndex, std::shared_ptr<DependenciesLabel> > store;
std::shared_ptr<DependenciesLabel> make(const std::string & class_name, const std::string & text)
@@ -137,7 +136,7 @@ namespace
std::shared_ptr<DependenciesLabel> get(const std::string & eapi_name, const std::string & class_name, const std::string & text)
{
- Lock lock(mutex);
+ std::unique_lock<std::mutex> lock(mutex);
DepLabelsIndex x{eapi_name, class_name, text};
auto i(store.find(x));
@@ -149,7 +148,7 @@ namespace
std::shared_ptr<DependenciesLabel> get_test(const std::string & eapi_name, const std::string & class_name,
const ChoiceNameWithPrefix & choice_name, const std::string & text)
{
- Lock lock(mutex);
+ std::unique_lock<std::mutex> lock(mutex);
DepLabelsIndex x{eapi_name, class_name, stringify(choice_name) + "/" + text};
auto i(store.find(x));
diff --git a/paludis/repositories/e/parse_plain_text_label.cc b/paludis/repositories/e/parse_plain_text_label.cc
index 1055e698b..ce0a83c5a 100644
--- a/paludis/repositories/e/parse_plain_text_label.cc
+++ b/paludis/repositories/e/parse_plain_text_label.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2005, 2006, 2007, 2008, 2009, 2010, 2011 Ciaran McCreesh
+ * Copyright (c) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2013 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -21,7 +21,6 @@
#include <paludis/repositories/e/dep_parser.hh>
#include <paludis/repositories/e/eapi.hh>
#include <paludis/util/log.hh>
-#include <paludis/util/mutex.hh>
#include <paludis/util/tokeniser.hh>
#include <paludis/util/singleton-impl.hh>
#include <paludis/dep_label.hh>
diff --git a/paludis/repositories/e/parse_uri_label.cc b/paludis/repositories/e/parse_uri_label.cc
index 4f2ef7bb9..55e4391be 100644
--- a/paludis/repositories/e/parse_uri_label.cc
+++ b/paludis/repositories/e/parse_uri_label.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2005, 2006, 2007, 2008, 2009, 2010, 2011 Ciaran McCreesh
+ * Copyright (c) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2013 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -21,7 +21,6 @@
#include <paludis/repositories/e/dep_parser.hh>
#include <paludis/repositories/e/eapi.hh>
#include <paludis/util/log.hh>
-#include <paludis/util/mutex.hh>
#include <paludis/util/tokeniser.hh>
#include <paludis/util/singleton-impl.hh>
#include <paludis/dep_label.hh>
@@ -39,7 +38,7 @@ namespace
struct URILabelsStore :
Singleton<URILabelsStore>
{
- Mutex mutex;
+ std::mutex mutex;
std::map<URILabelsIndex, std::shared_ptr<URILabel> > store;
std::shared_ptr<URILabel> make(const std::string & class_name, const std::string & text)
@@ -62,7 +61,7 @@ namespace
std::shared_ptr<URILabel> get(const std::string & eapi_name, const std::string & class_name, const std::string & text)
{
- Lock lock(mutex);
+ std::unique_lock<std::mutex> lock(mutex);
URILabelsIndex x{eapi_name, class_name, text};
auto i(store.find(x));
diff --git a/paludis/repositories/e/traditional_layout.cc b/paludis/repositories/e/traditional_layout.cc
index 41c5888f8..5ca63317c 100644
--- a/paludis/repositories/e/traditional_layout.cc
+++ b/paludis/repositories/e/traditional_layout.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2005, 2006, 2007, 2008, 2009, 2010, 2011 Ciaran McCreesh
+ * Copyright (c) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2013 Ciaran McCreesh
* Copyright (c) 2006 Danny van Dyk
*
* This file is part of the Paludis package manager. Paludis is free software;
@@ -33,7 +33,6 @@
#include <paludis/util/strip.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/wrapped_output_iterator.hh>
-#include <paludis/util/mutex.hh>
#include <paludis/util/set.hh>
#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/hashes.hh>
@@ -79,7 +78,7 @@ namespace paludis
const ERepository * const repository;
const FSPath tree_root;
- mutable Mutex big_nasty_mutex;
+ mutable std::recursive_mutex big_nasty_mutex;
mutable bool has_category_names;
mutable CategoryMap category_names;
@@ -188,7 +187,7 @@ TraditionalLayout::categories_file() const
void
TraditionalLayout::need_category_names() const
{
- Lock l(_imp->big_nasty_mutex);
+ std::unique_lock<std::recursive_mutex> lock(_imp->big_nasty_mutex);
if (_imp->has_category_names)
return;
@@ -259,7 +258,7 @@ TraditionalLayout::need_category_names() const
void
TraditionalLayout::need_package_ids(const QualifiedPackageName & n) const
{
- Lock l(_imp->big_nasty_mutex);
+ std::unique_lock<std::recursive_mutex> lock(_imp->big_nasty_mutex);
using namespace std::placeholders;
@@ -309,7 +308,7 @@ TraditionalLayout::need_package_ids(const QualifiedPackageName & n) const
bool
TraditionalLayout::has_category_named(const CategoryNamePart & c) const
{
- Lock l(_imp->big_nasty_mutex);
+ std::unique_lock<std::recursive_mutex> lock(_imp->big_nasty_mutex);
Context context("When checking for category '" + stringify(c) + "' in '" + stringify(_imp->repository->name()) + "':");
@@ -320,7 +319,7 @@ TraditionalLayout::has_category_named(const CategoryNamePart & c) const
bool
TraditionalLayout::has_package_named(const QualifiedPackageName & q) const
{
- Lock l(_imp->big_nasty_mutex);
+ std::unique_lock<std::recursive_mutex> lock(_imp->big_nasty_mutex);
Context context("When checking for package '" + stringify(q) + "' in '" + stringify(_imp->repository->name()) + ":");
@@ -355,7 +354,7 @@ TraditionalLayout::has_package_named(const QualifiedPackageName & q) const
void
TraditionalLayout::need_category_names_collection() const
{
- Lock l(_imp->big_nasty_mutex);
+ std::unique_lock<std::recursive_mutex> lock(_imp->big_nasty_mutex);
if (_imp->category_names_collection)
return;
@@ -371,7 +370,7 @@ TraditionalLayout::need_category_names_collection() const
std::shared_ptr<const CategoryNamePartSet>
TraditionalLayout::category_names() const
{
- Lock l(_imp->big_nasty_mutex);
+ std::unique_lock<std::recursive_mutex> lock(_imp->big_nasty_mutex);
Context context("When fetching category names in " + stringify(stringify(_imp->repository->name())) + ":");
@@ -382,7 +381,7 @@ TraditionalLayout::category_names() const
std::shared_ptr<const QualifiedPackageNameSet>
TraditionalLayout::package_names(const CategoryNamePart & c) const
{
- Lock l(_imp->big_nasty_mutex);
+ std::unique_lock<std::recursive_mutex> lock(_imp->big_nasty_mutex);
using namespace std::placeholders;
@@ -431,7 +430,7 @@ TraditionalLayout::package_names(const CategoryNamePart & c) const
std::shared_ptr<const PackageIDSequence>
TraditionalLayout::package_ids(const QualifiedPackageName & n) const
{
- Lock l(_imp->big_nasty_mutex);
+ std::unique_lock<std::recursive_mutex> lock(_imp->big_nasty_mutex);
Context context("When fetching versions of '" + stringify(n) + "' in " + stringify(_imp->repository->name()) + ":");
diff --git a/paludis/repositories/e/traditional_profile.cc b/paludis/repositories/e/traditional_profile.cc
index 8d857ce1b..cf34e713f 100644
--- a/paludis/repositories/e/traditional_profile.cc
+++ b/paludis/repositories/e/traditional_profile.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2005, 2006, 2007, 2008, 2009, 2010, 2011 Ciaran McCreesh
+ * Copyright (c) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2013 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -39,7 +39,6 @@
#include <paludis/util/create_iterator-impl.hh>
#include <paludis/util/config_file.hh>
#include <paludis/util/hashes.hh>
-#include <paludis/util/mutex.hh>
#include <paludis/util/map.hh>
#include <paludis/util/fs_stat.hh>
#include <paludis/util/fs_error.hh>
@@ -59,6 +58,7 @@
#include <algorithm>
#include <set>
#include <vector>
+#include <mutex>
#include <strings.h>
@@ -127,7 +127,7 @@ namespace paludis
std::shared_ptr<Set<std::string> > iuse_implicit;
std::unordered_map<std::string, std::shared_ptr<Set<std::string> > > use_expand_values;
KnownMap known_choice_value_names;
- mutable Mutex known_choice_value_names_for_separator_mutex;
+ mutable std::mutex known_choice_value_names_for_separator_mutex;
mutable std::unordered_map<char, KnownMap> known_choice_value_names_for_separator;
StackedValuesList stacked_values_list;
@@ -971,7 +971,7 @@ TraditionalProfile::known_choice_value_names(
const std::shared_ptr<const Choice> & choice
) const
{
- Lock l(_imp->known_choice_value_names_for_separator_mutex);
+ std::unique_lock<std::mutex> l(_imp->known_choice_value_names_for_separator_mutex);
char separator(id->eapi()->supported()->choices_options()->use_expand_separator());
std::unordered_map<char, KnownMap>::iterator it(_imp->known_choice_value_names_for_separator.find(separator));
diff --git a/paludis/repositories/e/vdb_repository.cc b/paludis/repositories/e/vdb_repository.cc
index 5c828dc31..eb5f44a20 100644
--- a/paludis/repositories/e/vdb_repository.cc
+++ b/paludis/repositories/e/vdb_repository.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006, 2007, 2008, 2009, 2010, 2011 Ciaran McCreesh
+ * Copyright (c) 2006, 2007, 2008, 2009, 2010, 2011, 2013 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -57,7 +57,6 @@
#include <paludis/slot.hh>
#include <paludis/util/accept_visitor.hh>
-#include <paludis/util/mutex.hh>
#include <paludis/util/is_file_with_extension.hh>
#include <paludis/util/log.hh>
#include <paludis/util/set.hh>
@@ -92,6 +91,7 @@
#include <list>
#include <map>
#include <iostream>
+#include <mutex>
#include <cstring>
#include <cerrno>
#include <ctime>
@@ -110,7 +110,7 @@ namespace paludis
{
VDBRepositoryParams params;
- const std::shared_ptr<Mutex> big_nasty_mutex;
+ const std::shared_ptr<std::recursive_mutex> big_nasty_mutex;
mutable CategoryMap categories;
mutable bool has_category_names;
@@ -118,7 +118,7 @@ namespace paludis
std::shared_ptr<RepositoryNameCache> names_cache;
- Imp(const VDBRepository * const, const VDBRepositoryParams &, std::shared_ptr<Mutex> = std::make_shared<Mutex>());
+ Imp(const VDBRepository * const, const VDBRepositoryParams &, std::shared_ptr<std::recursive_mutex> = std::make_shared<std::recursive_mutex>());
~Imp();
std::shared_ptr<const MetadataValueKey<FSPath> > location_key;
@@ -130,7 +130,7 @@ namespace paludis
};
Imp<VDBRepository>::Imp(const VDBRepository * const r,
- const VDBRepositoryParams & p, std::shared_ptr<Mutex> m) :
+ const VDBRepositoryParams & p, std::shared_ptr<std::recursive_mutex> m) :
params(p),
big_nasty_mutex(m),
has_category_names(false),
@@ -192,7 +192,7 @@ VDBRepository::_add_metadata_keys() const
bool
VDBRepository::has_category_named(const CategoryNamePart & c, const RepositoryContentMayExcludes &) const
{
- Lock l(*_imp->big_nasty_mutex);
+ std::unique_lock<std::recursive_mutex> lock(*_imp->big_nasty_mutex);
Context context("When checking for category '" + stringify(c) +
"' in " + stringify(name()) + ":");
@@ -204,7 +204,7 @@ VDBRepository::has_category_named(const CategoryNamePart & c, const RepositoryCo
bool
VDBRepository::has_package_named(const QualifiedPackageName & q, const RepositoryContentMayExcludes &) const
{
- Lock l(*_imp->big_nasty_mutex);
+ std::unique_lock<std::recursive_mutex> lock(*_imp->big_nasty_mutex);
Context context("When checking for package '" + stringify(q) +
"' in " + stringify(name()) + ":");
@@ -229,7 +229,7 @@ VDBRepository::is_unimportant() const
std::shared_ptr<const CategoryNamePartSet>
VDBRepository::category_names(const RepositoryContentMayExcludes &) const
{
- Lock l(*_imp->big_nasty_mutex);
+ std::unique_lock<std::recursive_mutex> lock(*_imp->big_nasty_mutex);
Context context("When fetching category names in " + stringify(name()) + ":");
@@ -246,7 +246,7 @@ VDBRepository::category_names(const RepositoryContentMayExcludes &) const
std::shared_ptr<const QualifiedPackageNameSet>
VDBRepository::package_names(const CategoryNamePart & c, const RepositoryContentMayExcludes & x) const
{
- Lock l(*_imp->big_nasty_mutex);
+ std::unique_lock<std::recursive_mutex> lock(*_imp->big_nasty_mutex);
Context context("When fetching package names in category '" + stringify(c)
+ "' in " + stringify(name()) + ":");
@@ -265,7 +265,7 @@ VDBRepository::package_names(const CategoryNamePart & c, const RepositoryContent
std::shared_ptr<const PackageIDSequence>
VDBRepository::package_ids(const QualifiedPackageName & n, const RepositoryContentMayExcludes & x) const
{
- Lock l(*_imp->big_nasty_mutex);
+ std::unique_lock<std::recursive_mutex> lock(*_imp->big_nasty_mutex);
Context context("When fetching versions of '" + stringify(n) + "' in "
+ stringify(name()) + ":");
@@ -567,7 +567,7 @@ VDBRepository::perform_uninstall(
void
VDBRepository::invalidate()
{
- Lock l(*_imp->big_nasty_mutex);
+ std::unique_lock<std::recursive_mutex> lock(*_imp->big_nasty_mutex);
_imp.reset(new Imp<VDBRepository>(this, _imp->params, _imp->big_nasty_mutex));
_add_metadata_keys();
}
@@ -575,7 +575,7 @@ VDBRepository::invalidate()
void
VDBRepository::regenerate_cache() const
{
- Lock l(*_imp->big_nasty_mutex);
+ std::unique_lock<std::recursive_mutex> lock(*_imp->big_nasty_mutex);
_imp->names_cache->regenerate_cache();
}
@@ -583,7 +583,7 @@ VDBRepository::regenerate_cache() const
std::shared_ptr<const CategoryNamePartSet>
VDBRepository::category_names_containing_package(const PackageNamePart & p, const RepositoryContentMayExcludes & x) const
{
- Lock l(*_imp->big_nasty_mutex);
+ std::unique_lock<std::recursive_mutex> lock(*_imp->big_nasty_mutex);
if (! _imp->names_cache->usable())
return Repository::category_names_containing_package(p, x);
@@ -803,7 +803,7 @@ VDBRepository::merge(const MergeParams & m)
void
VDBRepository::need_category_names() const
{
- Lock l(*_imp->big_nasty_mutex);
+ std::unique_lock<std::recursive_mutex> lock(*_imp->big_nasty_mutex);
if (_imp->has_category_names)
return;
@@ -832,7 +832,7 @@ VDBRepository::need_category_names() const
void
VDBRepository::need_package_ids(const CategoryNamePart & c) const
{
- Lock l(*_imp->big_nasty_mutex);
+ std::unique_lock<std::recursive_mutex> lock(*_imp->big_nasty_mutex);
if (_imp->categories[c])
return;
@@ -874,7 +874,7 @@ VDBRepository::need_package_ids(const CategoryNamePart & c) const
const std::shared_ptr<const ERepositoryID>
VDBRepository::make_id(const QualifiedPackageName & q, const VersionSpec & v, const FSPath & f) const
{
- Lock l(*_imp->big_nasty_mutex);
+ std::unique_lock<std::recursive_mutex> lock(*_imp->big_nasty_mutex);
Context context("When creating ID for '" + stringify(q) + "-" + stringify(v) + "' from '" + stringify(f) + "':");
@@ -885,7 +885,7 @@ VDBRepository::make_id(const QualifiedPackageName & q, const VersionSpec & v, co
const std::shared_ptr<const ERepositoryID>
VDBRepository::package_id_if_exists(const QualifiedPackageName & q, const VersionSpec & v) const
{
- Lock l(*_imp->big_nasty_mutex);
+ std::unique_lock<std::recursive_mutex> lock(*_imp->big_nasty_mutex);
if (! has_package_named(q, { }))
return std::shared_ptr<const ERepositoryID>();