Uploaded image for project: 'C Driver'
  1. C Driver
  2. CDRIVER-1439

Deal with spurious wakeups from pthread_cond_wait

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 1.5.0
    • Affects Version/s: None
    • Component/s: None
    • None

      From the manpage of pthread_cond_wait():

      {block}
      When using condition variables there is always a Boolean predicate involving shared variables associated with each condition wait that is true if the thread should proceed. Spurious wakeups from the pthread_cond_timedwait() or pthread_cond_wait() functions may occur. Since the return from pthread_cond_timedwait() or pthread_cond_wait() does not imply anything about the value of this predicate, the predicate should be re-evaluated upon such return.{block}

      Basically, pthread_cond_wait can return whenever it feels like! Our code in the mock server (and maybe elsewhere) doesn't deal with this case, and it should.

            Assignee:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Reporter:
            ian.boros@mongodb.com Ian Boros
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: