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

get_rnd_value() of ib_counter_t is unnecessarily complex

    XMLWordPrintable

Details

    Description

      The sharded shared counter template ib_counter_t uses the function my_timer_cycles() as a source of pseudo-random numbers. On some platforms, my_timer_cycles() could return the constant value of 0. The function get_rnd_value() would work around this at run time (while it should have been done at compilation time) and invoke the function pthread_self() if the returned value happened to be 0.

      To fix this, let us define a wrapper my_pseudo_random() that is either an alias of my_timer_cycles() or a wrapper for pthread_self(). In practice, the wrapper should only come into play on exotic operating systems or instruction set architectures.

      Attachments

        Issue Links

          Activity

            People

              marko Marko Mäkelä
              marko Marko Mäkelä
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

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