summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLorenz Quack <don@amberfisharts.com>2009-10-08 20:11:55 -0400
committerDwayne C. Litzenberger <dlitz@dlitz.net>2009-10-08 20:30:48 -0400
commitd4f1039754e6f25b703c6a824db21bc66ef57a07 (patch)
tree9d0485258d888a117b36ccdd32a305545c89ad14
parent4faac7f8b1023e67cb5b2e6783ee89f7a97e62bb (diff)
downloadpycrypto-d4f1039754e6f25b703c6a824db21bc66ef57a07.tar.gz
Apply patch to release the GIL inside isPrime()
This fixes https://bugs.launchpad.net/pycrypto/+bug/439958
-rwxr-xr-xsrc/_fastmath.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/_fastmath.c b/src/_fastmath.c
index 74708ab..0c036e3 100755
--- a/src/_fastmath.c
+++ b/src/_fastmath.c
@@ -785,7 +785,9 @@ isPrime (PyObject * self, PyObject * args)
mpz_init (n);
longObjToMPZ (n, (PyLongObject *) l);
+ Py_BEGIN_ALLOW_THREADS;
result = mpz_probab_prime_p(n, 5);
+ Py_END_ALLOW_THREADS;
mpz_clear (n);