summaryrefslogtreecommitdiff
path: root/Ports/cmake/patches/0024-shared-mutex.patch
blob: a765af2d8ef1e15b2de8900a316d03af4ed14c2d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
diff --git a/Source/cmServer.cxx b/Source/cmServer.cxx
index 7f97406..bebb100 100644
--- a/Source/cmServer.cxx
+++ b/Source/cmServer.cxx
@@ -251,7 +251,9 @@ cmFileMonitor* cmServer::FileMonitor() const
 void cmServer::WriteJsonObject(const Json::Value& jsonValue,
                                const DebugInfo* debug) const
 {
+#if 0
   cm::shared_lock<cm::shared_mutex> lock(ConnectionsMutex);
+#endif
   for (auto& connection : this->Connections) {
     WriteJsonObject(connection.get(), jsonValue, debug);
   }
@@ -458,7 +460,9 @@ bool cmServerBase::Serve(std::string* errorMessage)
   OnServeStart();
 
   {
+#if 0
     cm::shared_lock<cm::shared_mutex> lock(ConnectionsMutex);
+#endif
     for (auto& connection : Connections) {
       if (!connection->OnServeStart(errorMessage)) {
         return false;
@@ -494,7 +498,9 @@ void cmServerBase::StartShutDown()
   SIGHUPHandler.reset();
 
   {
+#if 0
     std::unique_lock<cm::shared_mutex> lock(ConnectionsMutex);
+#endif
     for (auto& connection : Connections) {
       connection->OnConnectionShuttingDown();
     }
@@ -541,7 +547,9 @@ cmServerBase::~cmServerBase()
 void cmServerBase::AddNewConnection(cmConnection* ownedConnection)
 {
   {
+#if 0
     std::unique_lock<cm::shared_mutex> lock(ConnectionsMutex);
+#endif
     Connections.emplace_back(ownedConnection);
   }
   ownedConnection->SetServer(this);
@@ -558,7 +566,9 @@ void cmServerBase::OnDisconnect(cmConnection* pConnection)
     return m.get() == pConnection;
   };
   {
+#if 0
     std::unique_lock<cm::shared_mutex> lock(ConnectionsMutex);
+#endif
     Connections.erase(
       std::remove_if(Connections.begin(), Connections.end(), pred),
       Connections.end());
diff --git a/Source/cmServer.h b/Source/cmServer.h
index 9543329..6a19be7 100644
--- a/Source/cmServer.h
+++ b/Source/cmServer.h
@@ -65,7 +65,9 @@ public:
   void OnDisconnect(cmConnection* pConnection);
 
 protected:
+#if 0
   mutable cm::shared_mutex ConnectionsMutex;
+#endif
   std::vector<std::unique_ptr<cmConnection>> Connections;
 
   bool ServeThreadRunning = false;
diff --git a/Utilities/std/cm/shared_mutex b/Utilities/std/cm/shared_mutex
index a1204fa..d4812c8 100644
--- a/Utilities/std/cm/shared_mutex
+++ b/Utilities/std/cm/shared_mutex
@@ -5,6 +5,7 @@
    file Copyright.txt or https://cmake.org/licensing for details.  */
 #pragma once
 
+#if 0
 #if __cplusplus >= 201402L || defined(_MSVC_LANG) && _MSVC_LANG >= 201402L
 #  define CMake_HAVE_CXX_SHARED_LOCK
 #endif
@@ -71,3 +72,4 @@ public:
 };
 #endif
 }
+#endif