aboutsummaryrefslogtreecommitdiff
path: root/paludis/repositories/accounts
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/accounts
parent39834ca3b05fadb14f855a8ab6dcea98c35738a7 (diff)
downloadpaludis-78d9a9bf0758140e0e8c03c5e8d3288f74efbb51.tar.gz
paludis-78d9a9bf0758140e0e8c03c5e8d3288f74efbb51.tar.xz
Switch to std mutex and condition_variable
Diffstat (limited to 'paludis/repositories/accounts')
-rw-r--r--paludis/repositories/accounts/accounts_id.cc11
-rw-r--r--paludis/repositories/accounts/installed_accounts_id.cc7
2 files changed, 8 insertions, 10 deletions
diff --git a/paludis/repositories/accounts/accounts_id.cc b/paludis/repositories/accounts/accounts_id.cc
index 4962665d2..ff985c19c 100644
--- a/paludis/repositories/accounts/accounts_id.cc
+++ b/paludis/repositories/accounts/accounts_id.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2009, 2010, 2011 Ciaran McCreesh
+ * Copyright (c) 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/hashes.hh>
#include <paludis/util/visitor_cast.hh>
#include <paludis/util/tokeniser.hh>
-#include <paludis/util/mutex.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/wrapped_output_iterator.hh>
#include <paludis/util/make_null_shared_ptr.hh>
@@ -82,7 +81,7 @@ namespace paludis
const bool is_user;
- mutable Mutex mutex;
+ mutable std::mutex mutex;
mutable bool has_file_keys;
mutable bool has_metadata_keys;
@@ -135,7 +134,7 @@ AccountsID::~AccountsID()
void
AccountsID::_add_metadata_keys() const
{
- Lock lock(_imp->mutex);
+ std::unique_lock<std::mutex> lock(_imp->mutex);
if (_imp->has_metadata_keys)
return;
@@ -177,7 +176,7 @@ AccountsID::_need_file_keys() const
if (_imp->has_file_keys)
return;
- Lock lock(_imp->mutex);
+ std::unique_lock<std::mutex> lock(_imp->mutex);
KeyValueConfigFile k(_imp->fs_location_key->parse_value(), { },
&KeyValueConfigFile::no_defaults, &KeyValueConfigFile::no_transformation);
@@ -252,7 +251,7 @@ AccountsID::need_keys_added() const
void
AccountsID::clear_metadata_keys() const
{
- Lock lock(_imp->mutex);
+ std::unique_lock<std::mutex> lock(_imp->mutex);
_imp->has_metadata_keys = false;
PackageID::clear_metadata_keys();
}
diff --git a/paludis/repositories/accounts/installed_accounts_id.cc b/paludis/repositories/accounts/installed_accounts_id.cc
index 1457d8b93..f0babf6fb 100644
--- a/paludis/repositories/accounts/installed_accounts_id.cc
+++ b/paludis/repositories/accounts/installed_accounts_id.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2009, 2010, 2011 Ciaran McCreesh
+ * Copyright (c) 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/tokeniser.hh>
#include <paludis/util/make_named_values.hh>
-#include <paludis/util/mutex.hh>
#include <paludis/util/log.hh>
#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/util/singleton-impl.hh>
@@ -78,7 +77,7 @@ namespace paludis
const RepositoryName repository_name;
const std::shared_ptr<const LiteralMetadataStringSetKey> behaviours_key;
- mutable Mutex mutex;
+ mutable std::mutex mutex;
mutable std::shared_ptr<const AccountsDepKey> dependencies_key;
const bool is_user;
@@ -111,7 +110,7 @@ InstalledAccountsID::~InstalledAccountsID()
void
InstalledAccountsID::need_keys_added() const
{
- Lock lock(_imp->mutex);
+ std::unique_lock<std::mutex> lock(_imp->mutex);
if (_imp->is_user && ! _imp->dependencies_key)
{