summaryrefslogtreecommitdiff
path: root/server/src/templatelist.cc
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/templatelist.cc')
-rw-r--r--server/src/templatelist.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/server/src/templatelist.cc b/server/src/templatelist.cc
index cdf2b4b..bbaefc3 100644
--- a/server/src/templatelist.cc
+++ b/server/src/templatelist.cc
@@ -58,6 +58,8 @@ static std::vector<std::string> listdir(std::string path)
TemplateList::TemplateList(std::string templatepath)
{
+ MutexAutolock lock(mutex);
+
this->templatepath = templatepath;
std::vector<std::string> templates = listdir(templatepath);
std::vector<std::string>::iterator i = templates.begin();
@@ -93,6 +95,8 @@ TemplateList::TemplateList(std::string templatepath)
std::string TemplateList::getLatestVersion(std::string templ) throw(Exception)
{
+ MutexAutolock lock(mutex);
+
if(find(templ) == end()) throw Exception("Template ["+templ+"] does not exist");
TemplateListItem mli = (*this)[templ];
if(mli.size() == 0) return "";