From 3d1a7cba71f6c843639f0b9a48b12017ff610112 Mon Sep 17 00:00:00 2001 From: Sergey Vojtovich Date: Wed, 30 Mar 2016 14:42:12 +1100 Subject: MDEV-8684: Remove delaying maths in ut_delay Also introduce compiler barrier properly on all architectures. --- storage/xtradb/ut/ut0ut.cc | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'storage/xtradb/ut') 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 */ -- cgit v1.2.1