diff src/pixelarray_methods.c @ 1001:7355da1a6df6

Release GIL where possible in PixelArray.
author marcus
date Wed, 09 Apr 2008 08:15:21 +0000
parents 46a786465642
children 9e42170b0f2e
line wrap: on
line diff
--- a/src/pixelarray_methods.c	Wed Apr 09 08:11:40 2008 +0000
+++ b/src/pixelarray_methods.c	Wed Apr 09 08:15:21 2008 +0000
@@ -205,6 +205,7 @@
     absystep = ABS (array->ystep);
     y = array->ystart;
 
+    Py_BEGIN_ALLOW_THREADS;
     /* Single value assignment. */
     switch (bpp)
     {
@@ -309,6 +310,8 @@
         }
         break;
     }
+    Py_END_ALLOW_THREADS;
+
     if (SDL_MUSTLOCK (newsurf) == 0)
         SDL_UnlockSurface (newsurf);
     newsf = PySurface_New (newsurf);
@@ -458,6 +461,7 @@
     if (distance)
         SDL_GetRGB (dcolor, surface->format, &r1, &g1, &b1);
 
+    Py_BEGIN_ALLOW_THREADS;
     switch (surface->format->BytesPerPixel)
     {
     case 1:
@@ -604,6 +608,7 @@
         break;
     }
     }
+    Py_END_ALLOW_THREADS;
     Py_RETURN_NONE;
 }
 
@@ -666,6 +671,7 @@
     absystep = ABS (newarray->ystep);
     y = newarray->ystart;
 
+    Py_BEGIN_ALLOW_THREADS;
     switch (surface->format->BytesPerPixel)
     {
     case 1:
@@ -845,5 +851,6 @@
         break;
     }
     }
+    Py_END_ALLOW_THREADS;
     return (PyObject *) newarray;
 }