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

Race condition in SOMETIMES/MONGO_SOMETIMES macros

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

      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@mongodb.com Billy Donahue
            Reporter:
            schwerin@mongodb.com Andy Schwerin
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: