0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-11-30 00:56:44 +01:00

rename func

This commit is contained in:
Dwight 2009-12-17 17:17:46 -05:00
parent 4771ba64e3
commit 9cc8e2608a
3 changed files with 8 additions and 7 deletions

View File

@ -50,7 +50,7 @@ namespace mongo {
friend class CmdCursorInfo;
DiskLoc _lastLoc; // use getter and setter not this (important)
unsigned _idleAgeMillis; // how long has the cursor been around, relative to server idle time
bool _liveForever; // if true, never time out cursor
bool _noTimeout; // if true, never time out cursor
bool _doingDeletes;
static CCById clientCursorsById;
@ -67,7 +67,7 @@ namespace mongo {
int pos; // # objects into the cursor so far
BSONObj query;
ClientCursor() : _idleAgeMillis(0), _liveForever(false), _doingDeletes(false), pos(0) {
ClientCursor() : _idleAgeMillis(0), _noTimeout(false), _doingDeletes(false), pos(0) {
recursive_boostlock lock(ccmutex);
cursorid = allocCursorId_inlock();
clientCursorsById.insert( make_pair(cursorid, this) );
@ -135,7 +135,7 @@ namespace mongo {
*/
bool shouldTimeout( unsigned millis ){
_idleAgeMillis += millis;
return ! _liveForever && _idleAgeMillis > 600000;
return ! _noTimeout && _idleAgeMillis > 600000;
}
unsigned idleTime(){
@ -144,8 +144,8 @@ namespace mongo {
static void idleTimeReport(unsigned millis);
void liveForever() {
_liveForever = true;
void noTimeout() {
_noTimeout = true;
}
void setDoingDeletes( bool doingDeletes ){

View File

@ -59,6 +59,7 @@ namespace mongo {
virtual DiskLoc currLoc() = 0;
virtual bool advance() = 0; /*true=ok*/
virtual BSONObj currKey() const { return BSONObj(); }
// DiskLoc the cursor requires for continued operation. Before this
// DiskLoc is deleted, the cursor must be incremented or destroyed.
virtual DiskLoc refLoc() = 0;

View File

@ -142,7 +142,7 @@ namespace mongo {
ClientCursor cc;
cc.c = creal;
cc.ns = ns;
cc.liveForever();
cc.noTimeout();
cc.setDoingDeletes( true );
do {
@ -827,7 +827,7 @@ namespace mongo {
if ( dqo.saveClientCursor() ) {
ClientCursor *cc = new ClientCursor();
if ( queryOptions & Option_NoCursorTimeout )
cc->liveForever();
cc->noTimeout();
cc->c = c;
cursorid = cc->cursorid;
cc->query = jsobj.getOwned();