Race condition in SOMETIMES/MONGO_SOMETIMES macros

XMLWordPrintableJSON

    • Fully Compatible
    • ALL
    • Dev Tools 2018-11-19
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

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

      #define MONGO_SOMETIMES( occasion, howOften ) for( static unsigned occasion = 0; ++occasion % howOften == 0; )
      

      Plain-and-simple not thread safe.

              Assignee:
              Billy Donahue
              Reporter:
              Andy Schwerin
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: