Skip to content

Commit

Permalink
MDEV-8684: innodb ut_delay - no maths
Browse files Browse the repository at this point in the history
Reintroduce 3d1a7cb
that removed the maths from ut_delay.

Existing definitions of UT_COMPILE_BARRIER used.

Signed-off-by: Daniel Black <daniel.black@au.ibm.com>
  • Loading branch information
grooverdan committed May 9, 2017
1 parent 3f5a8cb commit 015966d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
2 changes: 1 addition & 1 deletion storage/innobase/include/ut0ut.h
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ ut_sprintf_timestamp(
Runs an idle loop on CPU. The argument gives the desired delay
in microseconds on 100 MHz Pentium + Visual C++.
@return dummy value */
ulint
void
ut_delay(
/*=====*/
ulint delay); /*!< in: delay in microseconds on 100 MHz Pentium */
Expand Down
9 changes: 2 additions & 7 deletions storage/innobase/ut/ut0ut.cc
Original file line number Diff line number Diff line change
Expand Up @@ -285,26 +285,21 @@ ut_sprintf_timestamp(
Runs an idle loop on CPU. The argument gives the desired delay
in microseconds on 100 MHz Pentium + Visual C++.
@return dummy value */
ulint
void
ut_delay(
/*=====*/
ulint delay) /*!< in: delay in microseconds on 100 MHz Pentium */
{
ulint i, j;
ulint i;

UT_LOW_PRIORITY_CPU();

j = 0;

for (i = 0; i < delay * 50; i++) {
j += i;
UT_RELAX_CPU();
UT_COMPILER_BARRIER();
}

UT_RESUME_PRIORITY_CPU();

return(j);
}

/*************************************************************//**
Expand Down

0 comments on commit 015966d

Please sign in to comment.