summaryrefslogtreecommitdiff
path: root/storage/xtradb/ut
diff options
context:
space:
mode:
authorSergey Vojtovich <svoj@mariadb.org>2016-03-30 14:42:12 +1100
committerDaniel Black <daniel.black@au.ibm.com>2016-03-31 16:35:19 +1100
commit3d1a7cba71f6c843639f0b9a48b12017ff610112 (patch)
tree039ca7ae4b2754826b70d4c83a8208797ad06be4 /storage/xtradb/ut
parentd4ba50477e6f0092a3b83528c02c0f30a2b708a3 (diff)
downloadmariadb-git-3d1a7cba71f6c843639f0b9a48b12017ff610112.tar.gz
MDEV-8684: Remove delaying maths in ut_delay
Also introduce compiler barrier properly on all architectures.
Diffstat (limited to 'storage/xtradb/ut')
-rw-r--r--storage/xtradb/ut/ut0ut.cc10
1 files changed, 3 insertions, 7 deletions
diff --git a/storage/xtradb/ut/ut0ut.cc b/storage/xtradb/ut/ut0ut.cc
index 42fc04e5f81..acedb56879a 100644
--- a/storage/xtradb/ut/ut0ut.cc
+++ b/storage/xtradb/ut/ut0ut.cc
@@ -395,25 +395,21 @@ Runs an idle loop on CPU. The argument gives the desired delay
in microseconds on 100 MHz Pentium + Visual C++.
@return dummy value */
UNIV_INTERN
-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);
}
#endif /* !UNIV_HOTBACKUP */