Commit e9b3d6cc authored by Ian Lynagh's avatar Ian Lynagh
Browse files

Don't use threads on Windows

It seems to cause some sort of deadlock
parent 28c7e2c4
......@@ -103,23 +103,28 @@ for opt,arg in opts:
config.compile_ways = filter(neq(arg), config.compile_ways)
if opt == '--threads':
# Trac #1558 says threads don't work in python 2.4.4, but do
# in 2.5.2. Probably >= 2.5 is sufficient, but let's be
# conservative here.
# Some versions of python have things like '1c1' for some of
# these components (see trac #3091), but int() chokes on the
# 'c1', so we drop it.
(maj, min, pat) = platform.python_version_tuple()
# We wrap maj, min, and pat in str() to work around a bug in python
# 2.6.1
maj = int(re.sub('[^0-9].*', '', str(maj)))
min = int(re.sub('[^0-9].*', '', str(min)))
pat = int(re.sub('[^0-9].*', '', str(pat)))
if (maj, min, pat) >= (2, 5, 2):
config.threads = int(arg)
config.use_threads = 1
else:
print "Warning: Ignoring request to use threads as python version < 2.5.2"
config.threads = int(arg)
config.use_threads = 1
if config.use_threads == 1:
# Trac #1558 says threads don't work in python 2.4.4, but do
# in 2.5.2. Probably >= 2.5 is sufficient, but let's be
# conservative here.
# Some versions of python have things like '1c1' for some of
# these components (see trac #3091), but int() chokes on the
# 'c1', so we drop it.
(maj, min, pat) = platform.python_version_tuple()
# We wrap maj, min, and pat in str() to work around a bug in python
# 2.6.1
maj = int(re.sub('[^0-9].*', '', str(maj)))
min = int(re.sub('[^0-9].*', '', str(min)))
pat = int(re.sub('[^0-9].*', '', str(pat)))
if (maj, min, pat) < (2, 5, 2):
print "Warning: Ignoring request to use threads as python version < 2.5.2"
config.use_threads = 0
if windows:
print "Warning: Ignoring request to use threads as running on Windows"
config.use_threads = 0
# This has to come after arg parsing as the args can change the compiler
get_compiler_info()
......
......@@ -84,6 +84,12 @@ else
RUNTEST_OPTS += -e ghc_with_smp=0
endif
ifeq "$(WINDOWS)" "YES"
RUNTEST_OPTS += -e windows=True
else
RUNTEST_OPTS += -e windows=False
endif
ifneq "$(THREADS)" ""
RUNTEST_OPTS += --threads=$(THREADS)
endif
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment