summaryrefslogtreecommitdiff
path: root/check.py
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2018-01-26 14:32:06 -0800
committerGitHub <noreply@github.com>2018-01-26 14:32:06 -0800
commit6c081144e5bcf31edece0806c38d63c97257cc4c (patch)
tree517b939d2b0abdfe5b9c4908df62ddb9f7206093 /check.py
parent4ef6655e887e4088b8faf0cf5857fd49edbcd498 (diff)
downloadbinaryen-6c081144e5bcf31edece0806c38d63c97257cc4c.tar.gz
binaryen-6c081144e5bcf31edece0806c38d63c97257cc4c.tar.bz2
binaryen-6c081144e5bcf31edece0806c38d63c97257cc4c.zip
ThreadPool refactoring (#1389)
Refactor ThreadPool code for clarity and to fix some bugs with using the pool from different threads in parallel. We have a singleton pool, and need to ensure it is created only once and used only by one thread at a time. This model is a simple way to ensure we use a number of threads equal to the number of cores, more or less (a pool per Module might lead to number of cores * number of Modules being optimized). This refactoring adds a parent pointer in the worker threads (giving them direct access to the pool makes it simpler to make sure that pool and thread creation and teardown are threadsafe). This commit also adds proper locking around pool creation and pool usage.
Diffstat (limited to 'check.py')
-rwxr-xr-xcheck.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/check.py b/check.py
index 5a926bf8e..40092d93a 100755
--- a/check.py
+++ b/check.py
@@ -505,6 +505,8 @@ def run_gcc_torture_tests():
# build the C file separately
extra = [NATIVECC, src, '-c', '-o', 'example.o',
'-I' + os.path.join(options.binaryen_root, 'src'), '-g', '-L' + os.path.join(options.binaryen_bin, '..', 'lib'), '-pthread']
+ if src.endswith('.cpp'):
+ extra += ['-std=c++11']
print 'build: ', ' '.join(extra)
subprocess.check_call(extra)
# Link against the binaryen C library DSO, using an executable-relative rpath