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

Interruptible's Atomic timer parameter is not typesafe

    • Fully Compatible
    • ALL
    • v5.0, v4.4
    • Service Arch 2021-07-12

      SERVER-44047 added an AtomicWord* parameter to several Interruptible wait functions, expressed as an AtomicWord<Microseconds::rep>*. This provides no type safety about the Duration it represents. There's no difference in the type system between Microseconds::rep, Milliseconds::rep, or plain int64_t. Another parameter to these functions is a Milliseconds duration, so it's easy to get confused. We should be able to directly accept an atomically-updated Duration, or come up with a typesafe proxy that can synchronously update a Duration.

       

            Assignee:
            alex.li@mongodb.com Alex Li
            Reporter:
            billy.donahue@mongodb.com Billy Donahue
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: