summaryrefslogtreecommitdiff
path: root/src/mongo/db/catalog/collection_cursor_cache.h
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2014-04-06 15:07:21 -0400
committerEliot Horowitz <eliot@10gen.com>2014-04-07 12:25:13 -0400
commit97bead396f78b168eae2774af5b784827d8341c6 (patch)
treed3ed574f449b52c7132405c224242b78a7754e12 /src/mongo/db/catalog/collection_cursor_cache.h
parent8853a39ad644a394c4d137bc132d54914b810c1d (diff)
downloadmongo-97bead396f78b168eae2774af5b784827d8341c6.tar.gz
SERVER-13495: fix ClientCursor::_pinValue concurrency
Diffstat (limited to 'src/mongo/db/catalog/collection_cursor_cache.h')
-rw-r--r--src/mongo/db/catalog/collection_cursor_cache.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/mongo/db/catalog/collection_cursor_cache.h b/src/mongo/db/catalog/collection_cursor_cache.h
index 4e8254515de..284d303391f 100644
--- a/src/mongo/db/catalog/collection_cursor_cache.h
+++ b/src/mongo/db/catalog/collection_cursor_cache.h
@@ -33,6 +33,7 @@
#include "mongo/db/clientcursor.h"
#include "mongo/db/diskloc.h"
#include "mongo/db/invalidation_type.h"
+#include "mongo/db/namespace_string.h"
#include "mongo/platform/unordered_set.h"
#include "mongo/util/concurrency/mutex.h"
@@ -92,10 +93,19 @@ namespace mongo {
CursorId registerCursor( ClientCursor* cc );
void deregisterCursor( ClientCursor* cc );
+ bool eraseCursor( CursorId id, bool checkAuth );
+
void getCursorIds( std::set<CursorId>* openCursors );
std::size_t numCursors();
- ClientCursor* find( CursorId id );
+ /**
+ * @param pin - if true, will try to pin cursor
+ * if pinned already, will assert
+ * otherwise will pin
+ */
+ ClientCursor* find( CursorId id, bool pin );
+
+ void unpin( ClientCursor* cursor );
// ----------------------
@@ -113,7 +123,7 @@ namespace mongo {
CursorId _allocateCursorId_inlock();
void _deregisterCursor_inlock( ClientCursor* cc );
- string _ns;
+ NamespaceString _nss;
unsigned _collectionCacheRuntimeId;
scoped_ptr<PseudoRandom> _random;