FileAllocator::get not thread-safe

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Major - P3
    • 3.3.12
    • Affects Version/s: None
    • Component/s: MMAPv1
    • None
    • Fully Compatible
    • ALL
    • Sharding 2016-08-29
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      FileAllocator* FileAllocator::get() {
          if (!_instance)
              _instance = new FileAllocator();
          return _instance;
      }
      

      _instance must protect by mutex , or directly assign by new FileAllocator.

            Assignee:
            Andy Schwerin
            Reporter:
            Jianghua Yang
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: