From 3bba88408c5e892c99910bde8d86de5815c42800 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Wed, 3 Jan 2018 13:08:46 +0200 Subject: [PATCH] Remove random sleep interval from acquire_lock The function caused problems with tests and the random sleep is truly not needed (legacy code and it doesn't bring any visible benefits). --- server/core/skygw_utils.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/server/core/skygw_utils.cc b/server/core/skygw_utils.cc index 2ac4a429c..9ef3bac56 100644 --- a/server/core/skygw_utils.cc +++ b/server/core/skygw_utils.cc @@ -29,7 +29,6 @@ #include #include "maxscale/skygw_utils.h" #include -#include #include #if !defined(PATH_MAX) @@ -467,7 +466,7 @@ void acquire_lock(int* l) misscount += 1; if (misscount > 10) { - ts1.tv_nsec = (random_jkiss() % misscount) * 1000000; + ts1.tv_nsec = misscount * 1000000; nanosleep(&ts1, NULL); } }