glibc/tests/Regression/bz585674-free-race-in-mcheck-hooks/malloc_check.c
Sergey Kolosov ab4bc8a24e Extend the test coverage
Move some of the RHEL QE testcases upstream to Fedora.
2022-05-31 09:29:27 +02:00

21 lines
352 B
C

#include <stdlib.h>
#include <unistd.h>
int main(void)
{
unsigned int i;
#pragma omp parallel num_threads(256) private(i)
{
i = 1;
while (i != 2000) {
void *ptr = malloc(rand() % 65536);
usleep((rand() % 100) * 100);
free(ptr);
usleep((rand() % 100) * 100);
i++;
}
#pragma omp barrier
}
return 0;
}