aboutsummaryrefslogtreecommitdiff
path: root/python/query.cc
diff options
context:
space:
mode:
authorAvatar Piotr Jaroszyński <peper@gentoo.org> 2007-08-14 14:58:25 +0000
committerAvatar Piotr Jaroszyński <peper@gentoo.org> 2007-08-14 14:58:25 +0000
commit8c159f511ee47855454f1c45916c9b3a08c83bbf (patch)
treefb0ebcc589b1af5a73e929e7ed29a728a4379638 /python/query.cc
parentbb9dba60f87d94ef62b77369a794634bac174dd6 (diff)
downloadpaludis-8c159f511ee47855454f1c45916c9b3a08c83bbf.tar.gz
paludis-8c159f511ee47855454f1c45916c9b3a08c83bbf.tar.xz
(python) Thread safety.
Diffstat (limited to 'python/query.cc')
-rw-r--r--python/query.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/python/query.cc b/python/query.cc
index c7d132541..8f894fbfd 100644
--- a/python/query.cc
+++ b/python/query.cc
@@ -119,6 +119,8 @@ struct PythonQueryWrapper :
{
tr1::shared_ptr<RepositoryNameSequence> repositories(const Environment & e) const
{
+ Lock l(get_mutex());
+
if (bp::override f = get_override("repositories"))
return f(boost::cref(e));
return PythonQuery::repositories(e);
@@ -132,6 +134,8 @@ struct PythonQueryWrapper :
tr1::shared_ptr<CategoryNamePartSet> categories(const Environment & e,
tr1::shared_ptr<const RepositoryNameSequence> r) const
{
+ Lock l(get_mutex());
+
if (bp::override f = get_override("categories"))
return f(boost::cref(e), r);
return PythonQuery::categories(e, r);
@@ -147,6 +151,8 @@ struct PythonQueryWrapper :
tr1::shared_ptr<const RepositoryNameSequence> r,
tr1::shared_ptr<const CategoryNamePartSet> c) const
{
+ Lock l(get_mutex());
+
if (bp::override f = get_override("packages"))
return f(boost::cref(e), r, c);
return PythonQuery::packages(e, r, c);
@@ -163,6 +169,8 @@ struct PythonQueryWrapper :
tr1::shared_ptr<const RepositoryNameSequence> r,
tr1::shared_ptr<const QualifiedPackageNameSet> q) const
{
+ Lock l(get_mutex());
+
if (bp::override f = get_override("ids"))
return f(boost::cref(e), r, q);
return PythonQuery::ids(e, r, q);
@@ -177,6 +185,8 @@ struct PythonQueryWrapper :
std::string as_human_readable_string() const
{
+ Lock l(get_mutex());
+
if (bp::override f = get_override("as_human_readable_string"))
return f();
else