Aracılığıyla paylaş


Derleyici Hatası C3059

'var' : 'threadprivate' simgesi 'yan tümcesi' yan tümcesinde kullanılamaz

Açıklamalar

Yan tümcesinde threadprivate simgesi kullanıldı.

Example

Aşağıdaki örnek C3059 oluşturur:

// C3059.cpp
// compile with: /openmp
#include "omp.h"
int x, y;
#pragma omp threadprivate(x, y)

int main() {
   #pragma omp parallel private(x, y)   // C3059
   {
      x = y;
   }
}

Olası çözüm:

// C3059b.cpp
// compile with: /openmp
#include "omp.h"
int x = 0, y = 0;

int main() {
   #pragma omp parallel firstprivate(y) private(x)
   {
      x = y;
   }
}