Commits

Anonymous committed c90791f

Allow threads in the sdl initialization/quitting routines.

Comments (0)

Files changed (2)

 * (re)add tests
 * add examples
 * reorganise and add camera module
-* add portmidi wrapper.
+* add portmidi wrapper
+* add math module
+* add movie module
 * subsurfaces via surface[x:y,a:b]? Brought up by ctgPi via IRC
 
 Things to FIX:
 _sdl_init (PyObject *self, PyObject *args)
 {
     Uint32 flags;
-    
+    int retval;
+
     if (!_check_sdl ())
         return NULL;
 
     if (!PyArg_ParseTuple (args, "l:init", &flags))
         return NULL;
-    if (SDL_Init (flags) == -1)
+    
+    Py_BEGIN_ALLOW_THREADS;
+    retval = SDL_Init (flags);
+    Py_END_ALLOW_THREADS;
+    if (retval == -1)
         Py_RETURN_FALSE;
 
     SDL_MOD_STATE (self)->initialized = 1;
 _sdl_initsubsystem (PyObject *self, PyObject *args)
 {
     Uint32 flags;
+    int retval;
+
     if (!PyArg_ParseTuple (args, "l:init_subsystem", &flags))
         return NULL;
 
     if (SDL_MOD_STATE (self)->initialized == 0)
         return _sdl_init (self, args);
 
-    if (SDL_InitSubSystem (flags) == -1)
+    Py_BEGIN_ALLOW_THREADS;
+    retval = SDL_InitSubSystem (flags);
+    Py_END_ALLOW_THREADS;
+    if (retval == -1)
         Py_RETURN_FALSE;
     Py_RETURN_TRUE;
 }
     Uint32 flags;
     if (!PyArg_ParseTuple (args, "l:quit_subsystem", &flags))
         return NULL;
+    Py_BEGIN_ALLOW_THREADS;
     SDL_QuitSubSystem (flags);
+    Py_END_ALLOW_THREADS;
     Py_RETURN_NONE;
 }
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.