mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-12-04 12:15:46 +00:00
[OpenMP][Tools][Tests][NFC] Address flaky archer tests
Adding more concurrent threads significantly increases the chance that the data race can be observed during testing.
This commit is contained in:
parent
95ef464ac9
commit
4acc2f29a2
@ -19,7 +19,7 @@
|
||||
int main(int argc, char *argv[]) {
|
||||
int var = 0;
|
||||
|
||||
#pragma omp parallel num_threads(2) shared(var)
|
||||
#pragma omp parallel num_threads(8) shared(var)
|
||||
{
|
||||
#pragma omp critical
|
||||
{
|
||||
|
@ -22,7 +22,7 @@ int main(int argc, char *argv[]) {
|
||||
omp_nest_lock_t lock;
|
||||
omp_init_nest_lock(&lock);
|
||||
|
||||
#pragma omp parallel num_threads(2) shared(var)
|
||||
#pragma omp parallel num_threads(8) shared(var)
|
||||
{
|
||||
omp_set_nest_lock(&lock);
|
||||
omp_set_nest_lock(&lock);
|
||||
|
@ -22,7 +22,7 @@ int main(int argc, char *argv[]) {
|
||||
omp_lock_t lock;
|
||||
omp_init_lock(&lock);
|
||||
|
||||
#pragma omp parallel num_threads(2) shared(var)
|
||||
#pragma omp parallel num_threads(8) shared(var)
|
||||
{
|
||||
omp_set_lock(&lock);
|
||||
// Dummy locking.
|
||||
|
@ -19,7 +19,7 @@
|
||||
int main(int argc, char *argv[]) {
|
||||
int var = 0;
|
||||
|
||||
#pragma omp parallel num_threads(2) shared(var)
|
||||
#pragma omp parallel num_threads(8) shared(var)
|
||||
{ var++; }
|
||||
|
||||
int error = (var != 2);
|
||||
|
@ -21,7 +21,7 @@
|
||||
int main(int argc, char *argv[]) {
|
||||
int var = 0, a = 0;
|
||||
|
||||
#pragma omp parallel num_threads(2) shared(var, a)
|
||||
#pragma omp parallel num_threads(8) shared(var, a)
|
||||
#pragma omp master
|
||||
{
|
||||
#pragma omp task shared(var, a) depend(out : var)
|
||||
|
@ -21,7 +21,7 @@
|
||||
int main(int argc, char *argv[]) {
|
||||
int var = 0, a = 0;
|
||||
|
||||
#pragma omp parallel num_threads(2) shared(var, a)
|
||||
#pragma omp parallel num_threads(8) shared(var, a)
|
||||
#pragma omp master
|
||||
{
|
||||
#pragma omp task shared(var, a)
|
||||
|
@ -21,7 +21,7 @@
|
||||
int main(int argc, char *argv[]) {
|
||||
int var = 0, a = 0;
|
||||
|
||||
#pragma omp parallel num_threads(2) shared(var, a)
|
||||
#pragma omp parallel num_threads(8) shared(var, a)
|
||||
#pragma omp master
|
||||
{
|
||||
#pragma omp task shared(var, a)
|
||||
|
@ -17,7 +17,7 @@
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#define NUM_THREADS 2
|
||||
#define NUM_THREADS 8
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
int var = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user