From: Georg Baum Date: Sat, 5 Jul 2014 10:58:22 +0000 (+0200) Subject: Make newUnnamedFile() threadsafe X-Git-Tag: 2.2.0alpha1~1789 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=5c431b9335e7e698f866f516665a2c604e7be396;hp=922d48da27b4371a089fabc5bc1b6c660ad0f598;p=features.git Make newUnnamedFile() threadsafe --- diff --git a/src/buffer_funcs.cpp b/src/buffer_funcs.cpp index 3f64b909f2..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; @@ -172,9 +173,10 @@ Buffer * newFile(string const & filename, string const & templatename, Buffer * newUnnamedFile(FileName const & path, string const & prefix, string const & templatename) { - // FIXME THREAD static map file_number; + static Mutex mutex; + Mutex::Locker locker(&mutex); FileName filename; do {