Browse Source

HPCC-26769 Ensure various synchronization booleans are atomic

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>
Gavin Halliday 3 năm trước cách đây
mục cha
commit
b3c102ca60

+ 1 - 1
dali/base/dasess.cpp

@@ -1170,7 +1170,7 @@ class CLdapWorkItem : public Thread
     Linked<IUserDescriptor> udesc;
     Linked<IDaliLdapConnection> ldapconn;
     unsigned flags;
-    bool running;
+    std::atomic<bool> running;
     Semaphore contsem;
     Semaphore ready;
     Semaphore &threaddone;

+ 1 - 1
ecl/eclagent/eclagent.cpp

@@ -141,7 +141,7 @@ interface IHThorDebugSocketListener : extends IInterface
 class CHThorDebugSocketListener : public Thread, implements IHThorDebugSocketListener, implements IThreadFactory
 {
     unsigned port;
-    bool running;
+    std::atomic<bool> running;
     bool suspended;
     Semaphore started;
     Owned<ISocket> socket;

+ 1 - 1
ecl/eclccserver/eclccserver.cpp

@@ -915,7 +915,7 @@ class EclccServer : public CInterface, implements IThreadFactory, implements IAb
 
     unsigned threadsActive;
     CriticalSection threadActiveCrit;
-    bool running;
+    std::atomic<bool> running;
     CSDSServerStatus serverstatus;
     Owned<IJobQueue> queue;
     CriticalSection queueUpdateCS;

+ 1 - 1
roxie/ccd/ccdlistener.cpp

@@ -865,7 +865,7 @@ public:
 
 protected:
     unsigned poolSize;
-    bool running;
+    std::atomic<bool> running;
     bool suspended;
     Semaphore started;
     Owned<IThreadPool> pool;

+ 1 - 1
roxie/ccd/ccdprotocol.cpp

@@ -181,7 +181,7 @@ public:
     }
 
 protected:
-    bool running;
+    std::atomic<bool> running;
     Semaphore started;
     Owned<IThreadPool> pool;
 

+ 1 - 1
roxie/udplib/udptrs.cpp

@@ -638,7 +638,7 @@ class CSendManager : implements ISendManager, public CInterface
             return doRun();
         }
     protected:
-        bool running;
+        std::atomic<bool> running;
     public:
         StartedThread(const char *name) : Thread(name)
         {

+ 1 - 1
roxie/udplib/uttest.cpp

@@ -146,7 +146,7 @@ unsigned SendAsFastAsPossible::totalSent = 0;
 
 class Receiver : public Thread
 {
-    bool running;
+    std::atomic<bool> running;
     Semaphore started;
     offset_t allReceived;
     CriticalSection arsect;

+ 1 - 1
system/mp/mpcomm.cpp

@@ -442,7 +442,7 @@ class CMPChannel;
 
 class CMPConnectThread: public Thread
 {
-    bool running;
+    std::atomic<bool> running;
     bool listen;
     ISocket *listensock;
     CMPServer *parent;

+ 1 - 1
thorlcr/activities/thactivityutil.cpp

@@ -61,7 +61,7 @@ class CRowStreamLookAhead : public CSimpleInterfaceOf<IStartableEngineRowStream>
     CSlaveActivity &activity;
     bool allowspill, preserveGrouping;
     ILookAheadStopNotify *notify;
-    bool running = false;
+    std::atomic<bool> running{false};
     bool started = false;
     rowcount_t required;
     Semaphore startSem;

+ 1 - 1
thorlcr/master/thgraphmanager.cpp

@@ -80,7 +80,7 @@ class CJobManager : public CSimpleInterface, implements IJobManager, implements
         Owned<ISocket> sock;
         CJobManager &mgr;
     private:
-        volatile bool running;
+        std::atomic<bool> running;
     public:
         CThorDebugListener(CJobManager &_mgr) : threaded("CThorDebugListener", this), mgr(_mgr)
         {

+ 1 - 1
thorlcr/master/thmastermain.cpp

@@ -151,7 +151,7 @@ class CRegistryServer : public CSimpleInterface
     {
         CThreaded threaded;
         CRegistryServer &registry;
-        bool running;
+        std::atomic<bool> running;
     public:
         CDeregistrationWatch(CRegistryServer &_registry) : threaded("CDeregistrationWatch"), registry(_registry), running(false) { }
         ~CDeregistrationWatch()

+ 1 - 1
thorlcr/thorutil/thormisc.cpp

@@ -1264,7 +1264,7 @@ class CRowServer : public CSimpleInterface, implements IThreaded, implements IRo
     mptag_t mpTag;
     unsigned fetchBuffSize;
     Linked<IRowStream> seq;
-    bool running;
+    std::atomic<bool> running;
 
 public:
     IMPLEMENT_IINTERFACE_USING(CSimpleInterface);

+ 1 - 1
thorlcr/thorutil/thormisc.hpp

@@ -219,7 +219,7 @@ public:
 
 class graph_decl CTimeoutTrigger : public CInterface, implements IThreaded
 {
-    bool running;
+    std::atomic<bool> running;
     Semaphore todo;
     CriticalSection crit;
     unsigned timeout;