From: Georg Baum Date: Mon, 7 Jul 2014 19:38:39 +0000 (+0200) Subject: Make newUnnamedFile() threadsafe X-Git-Tag: 2.1.2~54 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=9dae9a9d4f7f283ac0f5f34a0b1cd7d264bca41f;p=features.git Make newUnnamedFile() threadsafe --- diff --git a/src/buffer_funcs.cpp b/src/buffer_funcs.cpp index 26bff558f6..03ecc90abe 100644 --- a/src/buffer_funcs.cpp +++ b/src/buffer_funcs.cpp @@ -47,6 +47,7 @@ #include "support/filetools.h" #include "support/gettext.h" #include "support/lstrings.h" +#include "support/mutex.h" #include "support/textutils.h" using namespace std; @@ -173,7 +174,9 @@ Buffer * newUnnamedFile(FileName const & path, string const & prefix, string const & templatename) { static map file_number; + static Mutex mutex; + Mutex::Locker locker(&mutex); FileName filename; do {