Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-5738

Race condition in ONCE/MONGO_ONCE macros

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 3.5.2
    • Affects Version/s: 2.1.1
    • Component/s: Internal Code
    • Labels:
      None
    • Fully Compatible
    • ALL
    • Platforms 2017-01-23

      The definition of MONGO_ONCE contains a race condition. It's current implementation is as follows:

      #define MONGO_ONCE for( static bool undone = true; undone; undone = false )
      

      Plain-and-simple not thread safe.

            Assignee:
            mark.benvenuto@mongodb.com Mark Benvenuto
            Reporter:
            schwerin@mongodb.com Andy Schwerin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: