aboutsummaryrefslogtreecommitdiff
path: root/python
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 /python
parent39834ca3b05fadb14f855a8ab6dcea98c35738a7 (diff)
downloadpaludis-78d9a9bf0758140e0e8c03c5e8d3288f74efbb51.tar.gz
paludis-78d9a9bf0758140e0e8c03c5e8d3288f74efbb51.tar.xz
Switch to std mutex and condition_variable
Diffstat (limited to 'python')
-rw-r--r--python/environment.cc52
-rw-r--r--python/mask.cc32
-rw-r--r--python/metadata_key.cc94
-rw-r--r--python/mutex.cc4
-rw-r--r--python/mutex.hh9
5 files changed, 96 insertions, 95 deletions
diff --git a/python/environment.cc b/python/environment.cc
index 32a2794c8..fa7bd58d5 100644
--- a/python/environment.cc
+++ b/python/environment.cc
@@ -55,7 +55,7 @@ class EnvironmentImplementationWrapper :
virtual void populate_sets() const
{
- Lock l(get_mutex());
+ std::unique_lock<std::recursive_mutex> l(get_mutex());
if (bp::override f = get_override("populate_sets"))
f();
@@ -66,7 +66,7 @@ class EnvironmentImplementationWrapper :
virtual bool accept_license(const std::string & s, const std::shared_ptr<const PackageID> & p) const
PALUDIS_ATTRIBUTE((warn_unused_result))
{
- Lock l(get_mutex());
+ std::unique_lock<std::recursive_mutex> l(get_mutex());
if (bp::override f = get_override("accept_license"))
return f(s, p);
@@ -77,7 +77,7 @@ class EnvironmentImplementationWrapper :
virtual bool accept_keywords(const std::shared_ptr<const KeywordNameSet> & k, const std::shared_ptr<const PackageID> & p) const
PALUDIS_ATTRIBUTE((warn_unused_result))
{
- Lock l(get_mutex());
+ std::unique_lock<std::recursive_mutex> l(get_mutex());
if (bp::override f = get_override("accept_keywords"))
return f(k, p);
@@ -88,7 +88,7 @@ class EnvironmentImplementationWrapper :
virtual const std::shared_ptr<const Mask> mask_for_breakage(const std::shared_ptr<const PackageID> & p) const
PALUDIS_ATTRIBUTE((warn_unused_result))
{
- Lock l(get_mutex());
+ std::unique_lock<std::recursive_mutex> l(get_mutex());
if (bp::override f = get_override("mask_for_breakage"))
return f(p);
@@ -99,7 +99,7 @@ class EnvironmentImplementationWrapper :
virtual const std::shared_ptr<const Mask> mask_for_user(const std::shared_ptr<const PackageID> & p, const bool b) const
PALUDIS_ATTRIBUTE((warn_unused_result))
{
- Lock l(get_mutex());
+ std::unique_lock<std::recursive_mutex> l(get_mutex());
if (bp::override f = get_override("mask_for_user"))
return f(p, b);
@@ -110,7 +110,7 @@ class EnvironmentImplementationWrapper :
virtual bool unmasked_by_user(const std::shared_ptr<const PackageID> & p, const std::string & s) const
PALUDIS_ATTRIBUTE((warn_unused_result))
{
- Lock l(get_mutex());
+ std::unique_lock<std::recursive_mutex> l(get_mutex());
if (bp::override f = get_override("unmasked_by_user"))
return f(p, s);
@@ -121,7 +121,7 @@ class EnvironmentImplementationWrapper :
virtual std::shared_ptr<const FSPathSequence> bashrc_files() const
PALUDIS_ATTRIBUTE((warn_unused_result))
{
- Lock l(get_mutex());
+ std::unique_lock<std::recursive_mutex> l(get_mutex());
if (bp::override f = get_override("bashrc_files"))
return f();
@@ -137,7 +137,7 @@ class EnvironmentImplementationWrapper :
virtual std::shared_ptr<const FSPathSequence> syncers_dirs() const
PALUDIS_ATTRIBUTE((warn_unused_result))
{
- Lock l(get_mutex());
+ std::unique_lock<std::recursive_mutex> l(get_mutex());
if (bp::override f = get_override("syncers_dirs"))
return f();
@@ -153,7 +153,7 @@ class EnvironmentImplementationWrapper :
virtual std::shared_ptr<const FSPathSequence> fetchers_dirs() const
PALUDIS_ATTRIBUTE((warn_unused_result))
{
- Lock l(get_mutex());
+ std::unique_lock<std::recursive_mutex> l(get_mutex());
if (bp::override f = get_override("fetchers_dirs"))
return f();
@@ -169,7 +169,7 @@ class EnvironmentImplementationWrapper :
virtual std::shared_ptr<const FSPathSequence> hook_dirs() const
PALUDIS_ATTRIBUTE((warn_unused_result))
{
- Lock l(get_mutex());
+ std::unique_lock<std::recursive_mutex> l(get_mutex());
if (bp::override f = get_override("hook_dirs"))
return f();
@@ -179,7 +179,7 @@ class EnvironmentImplementationWrapper :
virtual uid_t reduced_uid() const
{
- Lock l(get_mutex());
+ std::unique_lock<std::recursive_mutex> l(get_mutex());
if (bp::override f = get_override("reduced_uid"))
return f();
@@ -189,7 +189,7 @@ class EnvironmentImplementationWrapper :
virtual gid_t reduced_gid() const
{
- Lock l(get_mutex());
+ std::unique_lock<std::recursive_mutex> l(get_mutex());
if (bp::override f = get_override("reduced_gid"))
return f();
@@ -201,7 +201,7 @@ class EnvironmentImplementationWrapper :
virtual std::shared_ptr<const MirrorsSequence> mirrors(const std::string & s) const
PALUDIS_ATTRIBUTE((warn_unused_result))
{
- Lock l(get_mutex());
+ std::unique_lock<std::recursive_mutex> l(get_mutex());
if (bp::override f = get_override("mirrors"))
return f(s);
@@ -212,7 +212,7 @@ class EnvironmentImplementationWrapper :
virtual std::shared_ptr<const SetNameSet> set_names() const
PALUDIS_ATTRIBUTE((warn_unused_result))
{
- Lock l(get_mutex());
+ std::unique_lock<std::recursive_mutex> l(get_mutex());
if (bp::override f = get_override("set_names"))
return f();
@@ -228,7 +228,7 @@ class EnvironmentImplementationWrapper :
virtual const std::shared_ptr<const SetSpecTree> set(const SetName & s) const
PALUDIS_ATTRIBUTE((warn_unused_result))
{
- Lock l(get_mutex());
+ std::unique_lock<std::recursive_mutex> l(get_mutex());
if (bp::override f = get_override("set"))
return f(boost::cref(s));
@@ -251,7 +251,7 @@ class EnvironmentImplementationWrapper :
virtual std::string distribution() const
PALUDIS_ATTRIBUTE((warn_unused_result))
{
- Lock l(get_mutex());
+ std::unique_lock<std::recursive_mutex> l(get_mutex());
if (bp::override f = get_override("distribution"))
return f();
@@ -266,7 +266,7 @@ class EnvironmentImplementationWrapper :
virtual bool add_to_world(const QualifiedPackageName & s) const
{
- Lock l(get_mutex());
+ std::unique_lock<std::recursive_mutex> l(get_mutex());
if (bp::override f = get_override("add_to_world"))
return f(s);
else
@@ -275,7 +275,7 @@ class EnvironmentImplementationWrapper :
virtual bool add_to_world(const SetName & s) const
{
- Lock l(get_mutex());
+ std::unique_lock<std::recursive_mutex> l(get_mutex());
if (bp::override f = get_override("add_to_world"))
return f(s);
else
@@ -284,7 +284,7 @@ class EnvironmentImplementationWrapper :
virtual bool remove_from_world(const QualifiedPackageName & s) const
{
- Lock l(get_mutex());
+ std::unique_lock<std::recursive_mutex> l(get_mutex());
if (bp::override f = get_override("remove_from_world"))
return f(s);
else
@@ -293,7 +293,7 @@ class EnvironmentImplementationWrapper :
virtual bool remove_from_world(const SetName & s) const
{
- Lock l(get_mutex());
+ std::unique_lock<std::recursive_mutex> l(get_mutex());
if (bp::override f = get_override("remove_from_world"))
return f(s);
else
@@ -303,7 +303,7 @@ class EnvironmentImplementationWrapper :
virtual std::shared_ptr<PackageIDSequence> operator[] (const Selection & fg) const
PALUDIS_ATTRIBUTE((warn_unused_result))
{
- Lock l(get_mutex());
+ std::unique_lock<std::recursive_mutex> l(get_mutex());
if (bp::override f = get_override("__getitem__"))
return f(fg);
@@ -318,7 +318,7 @@ class EnvironmentImplementationWrapper :
virtual void need_keys_added() const
{
- Lock l(get_mutex());
+ std::unique_lock<std::recursive_mutex> l(get_mutex());
if (bp::override f = get_override("need_keys_added"))
f();
@@ -328,7 +328,7 @@ class EnvironmentImplementationWrapper :
virtual const std::shared_ptr<const MetadataValueKey<std::string> > format_key() const
{
- Lock l(get_mutex());
+ std::unique_lock<std::recursive_mutex> l(get_mutex());
if (bp::override f = get_override("format_key"))
return f();
@@ -338,7 +338,7 @@ class EnvironmentImplementationWrapper :
virtual const std::shared_ptr<const MetadataValueKey<FSPath> > config_location_key() const
{
- Lock l(get_mutex());
+ std::unique_lock<std::recursive_mutex> l(get_mutex());
if (bp::override f = get_override("config_location_key"))
return f();
@@ -348,7 +348,7 @@ class EnvironmentImplementationWrapper :
virtual const std::shared_ptr<const MetadataValueKey<FSPath> > preferred_root_key() const
{
- Lock l(get_mutex());
+ std::unique_lock<std::recursive_mutex> l(get_mutex());
if (bp::override f = get_override("preferred_root_key"))
return f();
@@ -358,7 +358,7 @@ class EnvironmentImplementationWrapper :
virtual const std::shared_ptr<const MetadataValueKey<FSPath> > system_root_key() const
{
- Lock l(get_mutex());
+ std::unique_lock<std::recursive_mutex> l(get_mutex());
if (bp::override f = get_override("system_root_key"))
return f();
diff --git a/python/mask.cc b/python/mask.cc
index c6ef7b66e..4a3fea6ed 100644
--- a/python/mask.cc
+++ b/python/mask.cc
@@ -84,7 +84,7 @@ struct MaskWrapper :
{
virtual char key() const
{
- Lock l(get_mutex());
+ std::unique_lock<std::recursive_mutex> l(get_mutex());
if (bp::override f = get_override("key"))
return f();
@@ -94,7 +94,7 @@ struct MaskWrapper :
virtual const std::string description() const
{
- Lock l(get_mutex());
+ std::unique_lock<std::recursive_mutex> l(get_mutex());
if (bp::override f = get_override("description"))
return f();
@@ -109,7 +109,7 @@ struct UserMaskWrapper :
{
virtual char key() const
{
- Lock l(get_mutex());
+ std::unique_lock<std::recursive_mutex> l(get_mutex());
if (bp::override f = get_override("key"))
return f();
@@ -119,7 +119,7 @@ struct UserMaskWrapper :
virtual const std::string description() const
{
- Lock l(get_mutex());
+ std::unique_lock<std::recursive_mutex> l(get_mutex());
if (bp::override f = get_override("description"))
return f();
@@ -134,7 +134,7 @@ struct UnacceptedMaskWrapper :
{
virtual const std::string unaccepted_key_name() const
{
- Lock l(get_mutex());
+ std::unique_lock<std::recursive_mutex> l(get_mutex());
if (bp::override f = get_override("unaccepted_key_name"))
return f();
@@ -144,7 +144,7 @@ struct UnacceptedMaskWrapper :
virtual char key() const
{
- Lock l(get_mutex());
+ std::unique_lock<std::recursive_mutex> l(get_mutex());
if (bp::override f = get_override("key"))
return f();
@@ -154,7 +154,7 @@ struct UnacceptedMaskWrapper :
virtual const std::string description() const
{
- Lock l(get_mutex());
+ std::unique_lock<std::recursive_mutex> l(get_mutex());
if (bp::override f = get_override("description"))
return f();
@@ -169,7 +169,7 @@ struct RepositoryMaskWrapper :
{
virtual const std::string mask_key_name() const
{
- Lock l(get_mutex());
+ std::unique_lock<std::recursive_mutex> l(get_mutex());
if (bp::override f = get_override("mask_key_name"))
return f();
@@ -179,7 +179,7 @@ struct RepositoryMaskWrapper :
virtual char key() const
{
- Lock l(get_mutex());
+ std::unique_lock<std::recursive_mutex> l(get_mutex());
if (bp::override f = get_override("key"))
return f();
@@ -189,7 +189,7 @@ struct RepositoryMaskWrapper :
virtual const std::string description() const
{
- Lock l(get_mutex());
+ std::unique_lock<std::recursive_mutex> l(get_mutex());
if (bp::override f = get_override("description"))
return f();
@@ -199,7 +199,7 @@ struct RepositoryMaskWrapper :
virtual const std::string comment() const
{
- Lock l(get_mutex());
+ std::unique_lock<std::recursive_mutex> l(get_mutex());
if (bp::override f = get_override("comment"))
return f();
@@ -209,7 +209,7 @@ struct RepositoryMaskWrapper :
virtual const std::string token() const
{
- Lock l(get_mutex());
+ std::unique_lock<std::recursive_mutex> l(get_mutex());
if (bp::override f = get_override("token"))
return f();
@@ -219,7 +219,7 @@ struct RepositoryMaskWrapper :
virtual const FSPath mask_file() const
{
- Lock l(get_mutex());
+ std::unique_lock<std::recursive_mutex> l(get_mutex());
if (bp::override f = get_override("mask_file"))
return f();
@@ -234,7 +234,7 @@ struct UnsupportedMaskWrapper :
{
virtual const std::string explanation() const
{
- Lock l(get_mutex());
+ std::unique_lock<std::recursive_mutex> l(get_mutex());
if (bp::override f = get_override("explanation"))
return f();
@@ -244,7 +244,7 @@ struct UnsupportedMaskWrapper :
virtual char key() const
{
- Lock l(get_mutex());
+ std::unique_lock<std::recursive_mutex> l(get_mutex());
if (bp::override f = get_override("key"))
return f();
@@ -254,7 +254,7 @@ struct UnsupportedMaskWrapper :
virtual const std::string description() const
{
- Lock l(get_mutex());
+ std::unique_lock<std::recursive_mutex> l(get_mutex());
if (bp::override f = get_override("description"))
return f();
diff --git a/python/metadata_key.cc b/python/metadata_key.cc
index f2f9b8561..a5f0a6a3a 100644
--- a/python/metadata_key.cc
+++ b/python/metadata_key.cc
@@ -182,7 +182,7 @@ struct MetadataPackageIDKeyWrapper :
virtual const std::shared_ptr<const PackageID> parse_value() const
PALUDIS_ATTRIBUTE((warn_unused_result))
{
- Lock l(get_mutex());
+ std::unique_lock<std::recursive_mutex> l(get_mutex());
if (bp::override f = get_override("parse_value"))
return f();
@@ -192,7 +192,7 @@ struct MetadataPackageIDKeyWrapper :
virtual const std::string raw_name() const
{
- Lock l(get_mutex());
+ std::unique_lock<std::recursive_mutex> l(get_mutex());
if (bp::override f = get_override("raw_name"))
return f();
@@ -202,7 +202,7 @@ struct MetadataPackageIDKeyWrapper :
virtual const std::string human_name() const
{
- Lock l(get_mutex());
+ std::unique_lock<std::recursive_mutex> l(get_mutex());
if (bp::override f = get_override("human_name"))
return f();
@@ -212,7 +212,7 @@ struct MetadataPackageIDKeyWrapper :
virtual MetadataKeyType type() const
{
- Lock l(get_mutex());
+ std::unique_lock<std::recursive_mutex> l(get_mutex());
if (bp::override f = get_override("type"))
return f();
@@ -235,7 +235,7 @@ struct MetadataStringKeyWrapper :
virtual const std::string parse_value() const
PALUDIS_ATTRIBUTE((warn_unused_result))
{
- Lock l(get_mutex());
+ std::unique_lock<std::recursive_mutex> l(get_mutex());
if (bp::override f = get_override("parse_value"))
return f();
@@ -245,7 +245,7 @@ struct MetadataStringKeyWrapper :
virtual const std::string raw_name() const
{
- Lock l(get_mutex());
+ std::unique_lock<std::recursive_mutex> l(get_mutex());
if (bp::override f = get_override("raw_name"))
return f();
@@ -255,7 +255,7 @@ struct MetadataStringKeyWrapper :
virtual const std::string human_name() const
{
- Lock l(get_mutex());
+ std::unique_lock<std::recursive_mutex> l(get_mutex());
if (bp::override f = get_override("human_name"))
return f();
@@ -265,7 +265,7 @@ struct MetadataStringKeyWrapper :
virtual MetadataKeyType type() const
{
- Lock l(get_mutex());
+ std::unique_lock<std::recursive_mutex> l(get_mutex());
if (bp::override f = get_override("type"))
return f();
@@ -281,7 +281,7 @@ struct MetadataSlotNameKeyWrapper :
virtual const Slot parse_value() const
PALUDIS_ATTRIBUTE((warn_unused_result))
{
- Lock l(get_mutex());
+ std::unique_lock<std::recursive_mutex> l(get_mutex());
if (bp::override f = get_override("parse_value"))
return f();
@@ -291,7 +291,7 @@ struct MetadataSlotNameKeyWrapper :
virtual const std::string raw_name() const
{
- Lock l(get_mutex());
+ std::unique_lock<std::recursive_mutex> l(get_mutex());
if (bp::override f = get_override("raw_name"))
return f();
@@ -301,7 +301,7 @@ struct MetadataSlotNameKeyWrapper :
virtual const std::string human_name() const
{
- Lock l(get_mutex());
+ std::unique_lock<std::recursive_mutex> l(get_mutex());
if (bp::override f = get_override("human_name"))
return f();
@@ -311,7 +311,7 @@ struct MetadataSlotNameKeyWrapper :
virtual MetadataKeyType type() const
{
- Lock l(get_mutex());
+ std::unique_lock<std::recursive_mutex> l(get_mutex());
if (bp::override f = get_override("type"))
return f();
@@ -336,7 +336,7 @@ struct MetadataSectionKeyWrapper :
virtual void need_keys_added() const
{
- Lock l(get_mutex());
+ std::unique_lock<std::recursive_mutex> l(get_mutex());
if (bp::override f = get_override("need_keys_added"))
f();
@@ -346,7 +346,7 @@ struct MetadataSectionKeyWrapper :
virtual const std::shared_ptr<const MetadataValueKey<std::string> > title_key() const
{
- Lock l(get_mutex());
+ std::unique_lock<std::recursive_mutex> l(get_mutex());
if (bp::override f = get_override("title_key"))
return f();
@@ -356,7 +356,7 @@ struct MetadataSectionKeyWrapper :
virtual const std::string raw_name() const
{
- Lock l(get_mutex());
+ std::unique_lock<std::recursive_mutex> l(get_mutex());
if (bp::override f = get_override("raw_name"))
return f();
@@ -366,7 +366,7 @@ struct MetadataSectionKeyWrapper :
virtual const std::string human_name() const
{
- Lock l(get_mutex());
+ std::unique_lock<std::recursive_mutex> l(get_mutex());
if (bp::override f = get_override("human_name"))
return f();
@@ -376,7 +376,7 @@ struct MetadataSectionKeyWrapper :
virtual MetadataKeyType type() const
{
- Lock l(get_mutex());
+ std::unique_lock<std::recursive_mutex> l(get_mutex());
if (bp::override f = get_override("type"))
return f();
@@ -392,7 +392,7 @@ struct MetadataTimeKeyWrapper :
virtual Timestamp parse_value() const
PALUDIS_ATTRIBUTE((warn_unused_result))
{
- Lock l(get_mutex());
+ std::unique_lock<std::recursive_mutex> l(get_mutex());
if (bp::override f = get_override("parse_value"))
return Timestamp(f(), 0);
@@ -402,7 +402,7 @@ struct MetadataTimeKeyWrapper :
virtual const std::string raw_name() const
{
- Lock l(get_mutex());
+ std::unique_lock<std::recursive_mutex> l(get_mutex());
if (bp::override f = get_override("raw_name"))
return f();
@@ -412,7 +412,7 @@ struct MetadataTimeKeyWrapper :
virtual const std::string human_name() const
{
- Lock l(get_mutex());
+ std::unique_lock<std::recursive_mutex> l(get_mutex());
if (bp::override f = get_override("human_name"))
return f();
@@ -422,7 +422,7 @@ struct MetadataTimeKeyWrapper :
virtual MetadataKeyType type() const
{
- Lock l(get_mutex());
+ std::unique_lock<std::recursive_mutex> l(get_mutex());
if (bp::override f = get_override("type"))
return f();
@@ -438,7 +438,7 @@ struct MetadataChoicesKeyWrapper :
virtual const std::shared_ptr<const Choices> parse_value() const
PALUDIS_ATTRIBUTE((warn_unused_result))
{
- Lock l(get_mutex());
+ std::unique_lock<std::recursive_mutex> l(get_mutex());
if (bp::override f = get_override("parse_value"))
return f();
@@ -448,7 +448,7 @@ struct MetadataChoicesKeyWrapper :
virtual const std::string raw_name() const
{
- Lock l(get_mutex());
+ std::unique_lock<std::recursive_mutex> l(get_mutex());
if (bp::override f = get_override("raw_name"))
return f();
@@ -458,7 +458,7 @@ struct MetadataChoicesKeyWrapper :
virtual const std::string human_name() const
{
- Lock l(get_mutex());
+ std::unique_lock<std::recursive_mutex> l(get_mutex());
if (bp::override f = get_override("human_name"))
return f();
@@ -468,7 +468,7 @@ struct MetadataChoicesKeyWrapper :
virtual MetadataKeyType type() const
{
- Lock l(get_mutex());
+ std::unique_lock<std::recursive_mutex> l(get_mutex());
if (bp::override f = get_override("type"))
return f();
@@ -484,7 +484,7 @@ struct MetadataFSPathKeyWrapper :
virtual const FSPath parse_value() const
PALUDIS_ATTRIBUTE((warn_unused_result))
{
- Lock l(get_mutex());
+ std::unique_lock<std::recursive_mutex> l(get_mutex());
if (bp::override f = get_override("parse_value"))
return f();
@@ -494,7 +494,7 @@ struct MetadataFSPathKeyWrapper :
virtual const std::string raw_name() const
{
- Lock l(get_mutex());
+ std::unique_lock<std::recursive_mutex> l(get_mutex());
if (bp::override f = get_override("raw_name"))
return f();
@@ -504,7 +504,7 @@ struct MetadataFSPathKeyWrapper :
virtual const std::string human_name() const
{
- Lock l(get_mutex());
+ std::unique_lock<std::recursive_mutex> l(get_mutex());
if (bp::override f = get_override("human_name"))
return f();
@@ -514,7 +514,7 @@ struct MetadataFSPathKeyWrapper :
virtual MetadataKeyType type() const
{
- Lock l(get_mutex());
+ std::unique_lock<std::recursive_mutex> l(get_mutex());
if (bp::override f = get_override("type"))
return f();
@@ -531,7 +531,7 @@ struct MetadataCollectionKeyWrapper :
virtual const std::shared_ptr<const C_> parse_value() const
PALUDIS_ATTRIBUTE((warn_unused_result))
{
- Lock l(get_mutex());
+ std::unique_lock<std::recursive_mutex> l(get_mutex());
if (bp::override f = this->get_override("parse_value"))
return f();
@@ -541,7 +541,7 @@ struct MetadataCollectionKeyWrapper :
virtual const std::string raw_name() const
{
- Lock l(get_mutex());
+ std::unique_lock<std::recursive_mutex> l(get_mutex());
if (bp::override f = this->get_override("raw_name"))
return f();
@@ -551,7 +551,7 @@ struct MetadataCollectionKeyWrapper :
virtual const std::string human_name() const
{
- Lock l(get_mutex());
+ std::unique_lock<std::recursive_mutex> l(get_mutex());
if (bp::override f = this->get_override("human_name"))
return f();
@@ -561,7 +561,7 @@ struct MetadataCollectionKeyWrapper :
virtual MetadataKeyType type() const
{
- Lock l(get_mutex());
+ std::unique_lock<std::recursive_mutex> l(get_mutex());
if (bp::override f = this->get_override("type"))
return f();
@@ -585,7 +585,7 @@ struct MetadataSpecTreeKeyWrapper :
virtual const std::shared_ptr<const C_> parse_value() const
PALUDIS_ATTRIBUTE((warn_unused_result))
{
- Lock l(get_mutex());
+ std::unique_lock<std::recursive_mutex> l(get_mutex());
if (bp::override f = this->get_override("parse_value"))
return f();
@@ -595,7 +595,7 @@ struct MetadataSpecTreeKeyWrapper :
virtual const std::string raw_name() const
{
- Lock l(get_mutex());
+ std::unique_lock<std::recursive_mutex> l(get_mutex());
if (bp::override f = this->get_override("raw_name"))
return f();
@@ -605,7 +605,7 @@ struct MetadataSpecTreeKeyWrapper :
virtual const std::string human_name() const
{
- Lock l(get_mutex());
+ std::unique_lock<std::recursive_mutex> l(get_mutex());
if (bp::override f = this->get_override("human_name"))
return f();
@@ -615,7 +615,7 @@ struct MetadataSpecTreeKeyWrapper :
virtual MetadataKeyType type() const
{
- Lock l(get_mutex());
+ std::unique_lock<std::recursive_mutex> l(get_mutex());
if (bp::override f = this->get_override("type"))
return f();
@@ -639,7 +639,7 @@ struct MetadataSpecTreeKeyWrapper<FetchableURISpecTree> :
virtual const std::shared_ptr<const FetchableURISpecTree> parse_value() const
PALUDIS_ATTRIBUTE((warn_unused_result))
{
- Lock l(get_mutex());
+ std::unique_lock<std::recursive_mutex> l(get_mutex());
if (bp::override f = this->get_override("parse_value"))
return f();
@@ -650,7 +650,7 @@ struct MetadataSpecTreeKeyWrapper<FetchableURISpecTree> :
virtual const std::shared_ptr<const URILabel> initial_label() const
PALUDIS_ATTRIBUTE((warn_unused_result))
{
- Lock l(get_mutex());
+ std::unique_lock<std::recursive_mutex> l(get_mutex());
if (bp::override f = this->get_override("initial_label"))
return f();
@@ -660,7 +660,7 @@ struct MetadataSpecTreeKeyWrapper<FetchableURISpecTree> :
virtual const std::string raw_name() const
{
- Lock l(get_mutex());
+ std::unique_lock<std::recursive_mutex> l(get_mutex());
if (bp::override f = get_override("raw_name"))
return f();
@@ -670,7 +670,7 @@ struct MetadataSpecTreeKeyWrapper<FetchableURISpecTree> :
virtual const std::string human_name() const
{
- Lock l(get_mutex());
+ std::unique_lock<std::recursive_mutex> l(get_mutex());
if (bp::override f = get_override("human_name"))
return f();
@@ -680,7 +680,7 @@ struct MetadataSpecTreeKeyWrapper<FetchableURISpecTree> :
virtual MetadataKeyType type() const
{
- Lock l(get_mutex());
+ std::unique_lock<std::recursive_mutex> l(get_mutex());
if (bp::override f = get_override("type"))
return f();
@@ -704,7 +704,7 @@ struct MetadataSpecTreeKeyWrapper<DependencySpecTree> :
virtual const std::shared_ptr<const DependencySpecTree> parse_value() const
PALUDIS_ATTRIBUTE((warn_unused_result))
{
- Lock l(get_mutex());
+ std::unique_lock<std::recursive_mutex> l(get_mutex());
if (bp::override f = this->get_override("parse_value"))
return f();
@@ -715,7 +715,7 @@ struct MetadataSpecTreeKeyWrapper<DependencySpecTree> :
virtual const std::shared_ptr<const DependenciesLabelSequence> initial_labels() const
PALUDIS_ATTRIBUTE((warn_unused_result))
{
- Lock l(get_mutex());
+ std::unique_lock<std::recursive_mutex> l(get_mutex());
if (bp::override f = this->get_override("initial_labels"))
return f();
@@ -725,7 +725,7 @@ struct MetadataSpecTreeKeyWrapper<DependencySpecTree> :
virtual const std::string raw_name() const
{
- Lock l(get_mutex());
+ std::unique_lock<std::recursive_mutex> l(get_mutex());
if (bp::override f = get_override("raw_name"))
return f();
@@ -735,7 +735,7 @@ struct MetadataSpecTreeKeyWrapper<DependencySpecTree> :
virtual const std::string human_name() const
{
- Lock l(get_mutex());
+ std::unique_lock<std::recursive_mutex> l(get_mutex());
if (bp::override f = get_override("human_name"))
return f();
@@ -745,7 +745,7 @@ struct MetadataSpecTreeKeyWrapper<DependencySpecTree> :
virtual MetadataKeyType type() const
{
- Lock l(get_mutex());
+ std::unique_lock<std::recursive_mutex> l(get_mutex());
if (bp::override f = get_override("type"))
return f();
diff --git a/python/mutex.cc b/python/mutex.cc
index e5eaaa4ce..5455f65f8 100644
--- a/python/mutex.cc
+++ b/python/mutex.cc
@@ -23,9 +23,9 @@ namespace paludis
{
namespace python
{
- Mutex & get_mutex()
+ std::recursive_mutex & get_mutex()
{
- static Mutex mutex;
+ static std::recursive_mutex mutex;
return mutex;
}
} // namespace paludis::python
diff --git a/python/mutex.hh b/python/mutex.hh
index 8f026a846..57cab1379 100644
--- a/python/mutex.hh
+++ b/python/mutex.hh
@@ -20,15 +20,16 @@
#ifndef PALUDIS_GUARD_PYTHON_MUTEX_HH
#define PALUDIS_GUARD_PYTHON_MUTEX_HH 1
-#include <paludis/util/mutex.hh>
+#include <paludis/util/attributes.hh>
+#include <mutex>
namespace paludis
{
namespace python
{
//global mutex for thread safety.
- Mutex & get_mutex() PALUDIS_VISIBLE;
- } // namespace paludis::python
-} // namespace paludis
+ std::recursive_mutex & get_mutex() PALUDIS_VISIBLE;
+ }
+}
#endif