summaryrefslogtreecommitdiff
path: root/src/mongo/db/client.h
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2012-04-18 18:06:06 -0400
committerEliot Horowitz <eliot@10gen.com>2012-04-18 18:06:06 -0400
commitdda8961cc4b604b633efbdc547677ee96a16c6e7 (patch)
tree3c68c39729769b30ec6d4f0f91cb03981d6433a0 /src/mongo/db/client.h
parent9185a4bfe54b59214f50c68604b6b6de1f7308af (diff)
downloadmongo-dda8961cc4b604b633efbdc547677ee96a16c6e7.tar.gz
get rid of writelock for Lock::GlobalWrite and Lock::DBWrite
Diffstat (limited to 'src/mongo/db/client.h')
-rw-r--r--src/mongo/db/client.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/mongo/db/client.h b/src/mongo/db/client.h
index d40d79436db..d3f35a4d38c 100644
--- a/src/mongo/db/client.h
+++ b/src/mongo/db/client.h
@@ -179,6 +179,16 @@ namespace mongo {
scoped_ptr<Context> c;
};
+ class WriteContext : boost::noncopyable {
+ public:
+ WriteContext(const string& ns, string path=dbpath, bool doauth=true );
+ Context& ctx() { return *c.get(); }
+ private:
+ Lock::DBWrite lk;
+ scoped_ptr<Context> c;
+
+ };
+
/* Set database we want to use, then, restores when we finish (are out of scope)
Note this is also helpful if an exception happens as the state if fixed up.
*/