summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2011-10-08 23:35:43 -0400
committerEliot Horowitz <eliot@10gen.com>2011-10-08 23:35:43 -0400
commit417b9110cecf0bd7aad7e0102d104b45b28c40dc (patch)
tree06795c9323dae42673f748cd683b5d96946bf5af
parent0f605b5ab37adaa3caa6bfb2ff3526b8202c94dc (diff)
downloadmongo-417b9110cecf0bd7aad7e0102d104b45b28c40dc.tar.gz
don't create ShardedConnectionInfo without an id
-rw-r--r--util/concurrency/value.h14
-rw-r--r--util/concurrency/vars.cpp2
2 files changed, 9 insertions, 7 deletions
diff --git a/util/concurrency/value.h b/util/concurrency/value.h
index 11ec6050127..35564d1cd13 100644
--- a/util/concurrency/value.h
+++ b/util/concurrency/value.h
@@ -47,25 +47,25 @@ namespace mongo {
class DiagStr {
string _s;
- static mutex m;
+ static SimpleMutex m;
public:
DiagStr(const DiagStr& r) : _s(r.get()) { }
DiagStr() { }
bool empty() const {
- mutex::scoped_lock lk(m);
+ SimpleMutex::scoped_lock lk(m);
return _s.empty();
}
string get() const {
- mutex::scoped_lock lk(m);
+ SimpleMutex::scoped_lock lk(m);
return _s;
}
void set(const char *s) {
- mutex::scoped_lock lk(m);
+ SimpleMutex::scoped_lock lk(m);
_s = s;
}
void set(const string& s) {
- mutex::scoped_lock lk(m);
+ SimpleMutex::scoped_lock lk(m);
_s = s;
}
operator string() const { return get(); }
@@ -76,6 +76,8 @@ namespace mongo {
}
};
+#if 0 // not including in 2.0
+
/** Thread safe map.
Be careful not to use this too much or it could make things slow;
if not a hot code path no problem.
@@ -125,5 +127,5 @@ namespace mongo {
V& operator[](const K& k) { return r[k]; }
};
};
-
+#endif
}
diff --git a/util/concurrency/vars.cpp b/util/concurrency/vars.cpp
index 213e57606e8..669725a1492 100644
--- a/util/concurrency/vars.cpp
+++ b/util/concurrency/vars.cpp
@@ -22,7 +22,7 @@
namespace mongo {
- mutex DiagStr::m("diags");
+ SimpleMutex DiagStr::m("diags");
// intentional leak. otherwise destructor orders can be problematic at termination.
MutexDebugger &mutexDebugger = *(new MutexDebugger());