Skip to content

Commit 710dcf6

Browse files
committed
Move OpenMP cleanup to base Task destructor
1 parent 67352f7 commit 710dcf6

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

modules/core/task/include/task.hpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
#include <iomanip>
1212
#include <iostream>
1313
#include <memory>
14+
#ifdef _OPENMP
15+
#include <omp.h>
16+
#endif
1417
#include <sstream>
1518
#include <stdexcept>
1619
#include <string>
@@ -177,6 +180,9 @@ class Task {
177180
} else {
178181
functions_order_.clear();
179182
}
183+
#ifdef _OPENMP
184+
omp_pause_resource_all(omp_pause_hard);
185+
#endif
180186
}
181187

182188
protected:

tasks/example_threads/omp/src/ops_omp.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#include <atomic>
44
#include <numeric>
55
#include <vector>
6+
#include <omp.h>
67

78
#include "core/util/include/util.hpp"
89
#include "example_threads/common/include/common.hpp"

0 commit comments

Comments
 (0)