Race condition in ONCE/MONGO_ONCE macros

XMLWordPrintableJSON

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

      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
            Reporter:
            Andy Schwerin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: