Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-3994

Use CLOCK_MONOTONIC for all pthread_cond_timedwait()

    XMLWordPrintable

Details

    • Task
    • Status: Stalled (View Workflow)
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • None

    Description

      Now all pthread conditions in MariaDB are created with the default attributes. It means that pthread_cond_timedwait() uses "realtime" clock, and changes in the system time (e.g., if the system administrator manually changes the clock) might interrupt timed condition waits. In almost all cases this is not desirable. To fix it, we should use

        pthread_condattr_setclock(attr, CLOCK_MONOTONIC)

      create all conditions with this attribute, and use

      clock_gettime(CLOCK_MONOTONIC, ...)

      when calculating wakeup time.

      Attachments

        Activity

          People

            serg Sergei Golubchik
            serg Sergei Golubchik
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.