Replace gmx::Mutex with std::mutex
[alexxy/gromacs.git] / src / gromacs / gpu_utils / clfftinitializer.cpp
index 5097649d478cfd8608375da038479712e52f8cb2..2734f2a9a2ae3fe49372ebff21272d62ef7f8f72 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2018,2019,2020, by the GROMACS development team, led by
+ * Copyright (c) 2018,2019,2020,2021, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 
 #include "config.h"
 
+#include <mutex>
+
 #include "gromacs/utility/basedefinitions.h"
 #include "gromacs/utility/exceptions.h"
-#include "gromacs/utility/mutex.h"
 #include "gromacs/utility/stringutil.h"
 
 #if GMX_GPU_OPENCL
@@ -68,7 +69,7 @@ namespace
  * initialize it more than once. */
 //! @{
 bool       g_clfftInitialized = false;
-gmx::Mutex g_clfftMutex;
+std::mutex g_clfftMutex;
 //! @}
 #endif
 
@@ -77,7 +78,7 @@ gmx::Mutex g_clfftMutex;
 ClfftInitializer::ClfftInitializer()
 {
 #if GMX_GPU_OPENCL
-    gmx::lock_guard<gmx::Mutex> guard(g_clfftMutex);
+    std::lock_guard<std::mutex> guard(g_clfftMutex);
     clfftSetupData              fftSetup;
     int                         initErrorCode = clfftInitSetupData(&fftSetup);
     if (initErrorCode != 0)
@@ -98,7 +99,7 @@ ClfftInitializer::ClfftInitializer()
 ClfftInitializer::~ClfftInitializer()
 {
 #if GMX_GPU_OPENCL
-    gmx::lock_guard<gmx::Mutex> guard(g_clfftMutex);
+    std::lock_guard<std::mutex> guard(g_clfftMutex);
     if (g_clfftInitialized)
     {
         clfftTeardown();