aboutsummaryrefslogtreecommitdiff
path: root/libbutl/process-details.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'libbutl/process-details.hxx')
-rw-r--r--libbutl/process-details.hxx27
1 files changed, 22 insertions, 5 deletions
diff --git a/libbutl/process-details.hxx b/libbutl/process-details.hxx
index 571c750..10d5241 100644
--- a/libbutl/process-details.hxx
+++ b/libbutl/process-details.hxx
@@ -3,12 +3,25 @@
#pragma once
-#include <libbutl/ft/shared_mutex.hxx>
+#ifdef LIBBUTL_MINGW_STDTHREAD
-#include <mutex>
-#if defined(__cpp_lib_shared_mutex) || defined(__cpp_lib_shared_timed_mutex)
-# include <shared_mutex>
-#endif
+# include <libbutl/mingw-shared_mutex.hxx>
+
+namespace butl
+{
+ using shared_mutex = mingw_stdthread::shared_mutex;
+ using ulock = mingw_stdthread::unique_lock<shared_mutex>;
+ using slock = mingw_stdthread::shared_lock<shared_mutex>;
+}
+
+#else // LIBBUTL_MINGW_STDTHREADS
+
+# include <libbutl/ft/shared_mutex.hxx>
+
+# include <mutex>
+# if defined(__cpp_lib_shared_mutex) || defined(__cpp_lib_shared_timed_mutex)
+# include <shared_mutex>
+# endif
namespace butl
{
@@ -36,7 +49,11 @@ namespace butl
using ulock = std::unique_lock<shared_mutex>;
using slock = ulock;
#endif
+}
+#endif // LIBBUTL_MINGW_STDTHREADS
+namespace butl
+{
// Mutex that is acquired to make a sequence of operations atomic in regards
// to child process spawning. Must be aquired for exclusive access for child
// process startup, and for shared access otherwise. Defined in process.cxx.