Browse Source

Merge pull request #3334 from jakesmith/loaddefaultbases-race-fix

HPCC-7812 DFS loadDefaultBases race condition

Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 12 years ago
parent
commit
44ae1b976f
1 changed files with 6 additions and 0 deletions
  1. 6 0
      dali/base/dafdesc.cpp

+ 6 - 0
dali/base/dafdesc.cpp

@@ -2183,8 +2183,14 @@ static StringAttr unixreplicatedir;
 
 static StringAttr defaultpartmask("$L$._$P$_of_$N$");
 
+static SpinLock ldbSpin;
+static bool ldbDone = false;
 void loadDefaultBases()
 {
+    SpinBlock b(ldbSpin);
+    if (ldbDone)
+        return;
+    ldbDone = true;
     // assumed default first thor
     // first set 
     if (winreplicatedir.isEmpty())