summaryrefslogtreecommitdiff
path: root/unittest
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2019-01-16 14:28:37 +0000
committerSergey Vojtovich <svoj@mariadb.org>2019-01-16 23:41:57 +0400
commit459d6da86955c89e96f6e9a8d3bc2a9b1756629b (patch)
treed336b46a28ff675ea7f8aa1188d9b0f0bbf5b6ac /unittest
parent1ecccb509c9dfa57976a2e2c3af07753a5356188 (diff)
downloadmariadb-git-459d6da86955c89e96f6e9a8d3bc2a9b1756629b.tar.gz
MDEV-18269 - fix off-by-one bug in unittest
Fix the off-by-one overflow which was introduced with commit b0fd06a6f2721 (MDEV-15670 - unit.my_atomic failed in buildbot with Signal 11 thrown) Closes #1098.
Diffstat (limited to 'unittest')
-rw-r--r--unittest/mysys/thr_template.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/unittest/mysys/thr_template.c b/unittest/mysys/thr_template.c
index d1bc0868ca0..0e06bf6e731 100644
--- a/unittest/mysys/thr_template.c
+++ b/unittest/mysys/thr_template.c
@@ -34,7 +34,7 @@ void test_concurrently(const char *test, pthread_handler handler, int n, int m)
bad= 0;
diag("Testing %s with %d threads, %d iterations... ", test, n, m);
- for (i= n; i; i--)
+ for (i= 0; i < n; i++)
{
if (pthread_create(&threads[i], 0, handler, &m) != 0)
{
@@ -43,7 +43,7 @@ void test_concurrently(const char *test, pthread_handler handler, int n, int m)
}
}
- for (i= n; i; i--)
+ for (i= 0; i < n; i++)
pthread_join(threads[i], 0);
now= my_interval_timer() - now;