Browse Source

Merge pull request #3896 from wangkx/h8633

HPCC-8633 Add mutex to control data access for preflight result

Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 12 years ago
parent
commit
7f251b6638

+ 2 - 0
esp/services/ws_machine/ws_machineService.cpp

@@ -1421,6 +1421,8 @@ void Cws_machineEx::setMachineInfo(IEspContext& context, CMachineInfoThreadParam
         if (pParam->m_options.getGetSoftwareInfo() && process.getType() && strieq(process.getType(), eqEclAgent))
             pMachineInfo1.setown(static_cast<IEspMachineInfoEx*>(new CMachineInfoEx("")));
         setProcessInfo(context, pParam, response, error, process, idx<1, pMachineInfo, pMachineInfo1);
+
+        synchronized block(mutex_machine_info_table);
         pParam->m_machineInfoTable.append(*pMachineInfo.getLink());
         if (pMachineInfo1)
             pParam->m_machineInfoTable.append(*pMachineInfo1.getLink());

+ 1 - 0
esp/services/ws_machine/ws_machineService.hpp

@@ -714,6 +714,7 @@ private:
     set<string>                 m_excludePartitionPatterns;
     StringBuffer                m_machineInfoFile;
     BoolHash                    m_legacyFilters;
+    Mutex                       mutex_machine_info_table;
 };
 
 //---------------------------------------------------------------------------------------------