Skip to content

Commit 459d6da

Browse files
ncopasvoj
authored andcommitted
MDEV-18269 - fix off-by-one bug in unittest
Fix the off-by-one overflow which was introduced with commit b0fd06a (MDEV-15670 - unit.my_atomic failed in buildbot with Signal 11 thrown) Closes #1098.
1 parent 1ecccb5 commit 459d6da

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

unittest/mysys/thr_template.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ void test_concurrently(const char *test, pthread_handler handler, int n, int m)
3434
bad= 0;
3535

3636
diag("Testing %s with %d threads, %d iterations... ", test, n, m);
37-
for (i= n; i; i--)
37+
for (i= 0; i < n; i++)
3838
{
3939
if (pthread_create(&threads[i], 0, handler, &m) != 0)
4040
{
@@ -43,7 +43,7 @@ void test_concurrently(const char *test, pthread_handler handler, int n, int m)
4343
}
4444
}
4545

46-
for (i= n; i; i--)
46+
for (i= 0; i < n; i++)
4747
pthread_join(threads[i], 0);
4848

4949
now= my_interval_timer() - now;

0 commit comments

Comments
 (0)