Download cpp source code

#include <iostream>

int main() {
  // ...
  #pragma omp parallel
  {
    // ...
    #pragma omp critical(cout)
    std::cout << "Hello from a thread" << std::endl;
    // ...
  }
  // ...
  return 0;
}