0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 01:21:03 +01:00

don't lock in ChunkManager constructor

This commit is contained in:
Eliot Horowitz 2010-06-02 17:01:28 -04:00
parent 2b732cf4da
commit 0606c4947e
2 changed files with 5 additions and 1 deletions

View File

@ -512,7 +512,7 @@ namespace mongo {
_sequenceNumber( ++NextSequenceNumber ), _lock("rw:ChunkManager")
{
_reload();
_reload_inlock();
if ( _chunks.size() == 0 ){
ChunkPtr c( new Chunk( this ) );
@ -539,7 +539,10 @@ namespace mongo {
void ChunkManager::_reload(){
rwlock lk( _lock , true );
_reload_inlock();
}
void ChunkManager::_reload_inlock(){
int tries = 3;
while (tries--){
_chunks.clear();

View File

@ -308,6 +308,7 @@ namespace mongo {
private:
void _reload();
void _reload_inlock();
void _load();
DBConfig * _config;