summarylogtreecommitdiffstats
path: root/memoryfix.patch
diff options
context:
space:
mode:
Diffstat (limited to 'memoryfix.patch')
-rw-r--r--memoryfix.patch36
1 files changed, 36 insertions, 0 deletions
diff --git a/memoryfix.patch b/memoryfix.patch
new file mode 100644
index 000000000000..9680f63e3760
--- /dev/null
+++ b/memoryfix.patch
@@ -0,0 +1,36 @@
+-- pycam-0.5.1.orig/src/pycam/Utils/threading.py 2011-06-10 10:54:51.000000000 -0400
++++ pycam-0.5.1/src/pycam/Utils/threading.py 2011-11-13 15:50:34.294437639 -0500
+@@ -639,18 +639,21 @@
+ if __multiprocessing and not disable_multiprocessing:
+ # use the number of CPUs as the default number of worker threads
+ pool = __multiprocessing.Pool(__num_of_processes)
+- if unordered:
+- imap_func = pool.imap_unordered
+- else:
+- imap_func = pool.imap
+- # Beware: we may not return "pool.imap" or "pool.imap_unordered"
+- # directly. It would somehow loose the focus and just hang infinitely.
+- # Thus we wrap our own generator around it.
+- for result in imap_func(func, args):
+- if callback and callback():
+- # cancel requested
+- break
+- yield result
++ try:
++ if unordered:
++ imap_func = pool.imap_unordered
++ else:
++ imap_func = pool.imap
++ # Beware: we may not return "pool.imap" or "pool.imap_unordered"
++ # directly. It would somehow loose the focus and just hang infinitely.
++ # Thus we wrap our own generator around it.
++ for result in imap_func(func, args):
++ if callback and callback():
++ # cancel requested
++ break
++ yield result
++ finally:
++ pool.terminate()
+ else:
+ for arg in args:
+ if callback and callback():