aboutsummaryrefslogtreecommitdiff
path: root/paludis/python_hooks.cc
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/python_hooks.cc
parent39834ca3b05fadb14f855a8ab6dcea98c35738a7 (diff)
downloadpaludis-78d9a9bf0758140e0e8c03c5e8d3288f74efbb51.tar.gz
paludis-78d9a9bf0758140e0e8c03c5e8d3288f74efbb51.tar.xz
Switch to std mutex and condition_variable
Diffstat (limited to 'paludis/python_hooks.cc')
-rw-r--r--paludis/python_hooks.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/paludis/python_hooks.cc b/paludis/python_hooks.cc
index ebe800100..e47fc7a58 100644
--- a/paludis/python_hooks.cc
+++ b/paludis/python_hooks.cc
@@ -10,11 +10,11 @@
#include <paludis/util/stringify.hh>
#include <paludis/util/strip.hh>
#include <paludis/util/system.hh>
-#include <paludis/util/mutex.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/env_var_names.hh>
+#include <mutex>
#include <set>
using namespace paludis;
@@ -32,7 +32,7 @@ namespace
public HookFile
{
private:
- static Mutex _mutex;
+ static std::mutex _mutex;
static bp::dict _local_namespace_base;
static bp::dict _output_wrapper_namespace;
@@ -78,7 +78,7 @@ namespace
}
};
- Mutex PyHookFile::_mutex;
+ std::mutex PyHookFile::_mutex;
bp::dict PyHookFile::_output_wrapper_namespace;
bp::dict PyHookFile::_local_namespace_base;
bp::object PyHookFile::_format_exception;
@@ -90,7 +90,7 @@ PyHookFile::PyHookFile(const FSPath & f, const bool r, const Environment * const
_run_prefixed(r),
_loaded(false)
{
- Lock l(_mutex);
+ std::unique_lock<std::mutex> l(_mutex);
static bool initialized(false);
@@ -158,7 +158,7 @@ PyHookFile::run(const Hook & hook, const std::shared_ptr<OutputManager> &) const
if (! _loaded)
return make_named_values<HookResult>(n::max_exit_status() = 0, n::output() = "");
- Lock l(_mutex);
+ std::unique_lock<std::mutex> l(_mutex);
bp::object _run;
@@ -243,7 +243,7 @@ PyHookFile::add_dependencies(const Hook & hook, DirectedGraph<std::string, int>
if (! _loaded)
return;
- Lock l(_mutex);
+ std::unique_lock<std::mutex> l(_mutex);
Prefix p(this, _run_prefixed ? strip_trailing_string(file_name().basename(), ".py") + "> " : "");