aboutsummaryrefslogtreecommitdiff
path: root/libbutl/diagnostics.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2022-05-10 09:48:08 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2022-05-10 09:48:08 +0200
commitea2b4fb4935627e4dea48f193eeb0019155a3abe (patch)
tree8dd1bbecf9ff634616d7b2717f7b46fcc64fc364 /libbutl/diagnostics.cxx
parent3cb2d76c1e2375ecce69f2c3f462be979295c753 (diff)
Use our own implementation of C++14 threads on MinGWmingw-stdthread
Diffstat (limited to 'libbutl/diagnostics.cxx')
-rw-r--r--libbutl/diagnostics.cxx12
1 files changed, 11 insertions, 1 deletions
diff --git a/libbutl/diagnostics.cxx b/libbutl/diagnostics.cxx
index 0826375..f574fd6 100644
--- a/libbutl/diagnostics.cxx
+++ b/libbutl/diagnostics.cxx
@@ -17,6 +17,12 @@
#include <cstddef> // size_t
#include <iostream> // cerr
+#ifndef LIBBUTL_MINGW_STDTHREAD
+# include <mutex>
+#else
+# include <libbutl/mingw-mutex.hxx>
+#endif
+
#include <libbutl/ft/lang.hxx> // thread_local
#include <libbutl/utility.hxx>
@@ -29,7 +35,11 @@ namespace butl
{
ostream* diag_stream = &cerr;
- static mutex diag_mutex;
+#ifndef LIBBUTL_MINGW_STDTHREAD
+ static std::mutex diag_mutex;
+#else
+ static mingw_stdthread::mutex diag_mutex;
+#endif
string diag_progress;
static string diag_progress_blank; // Being printed blanks out the line.