Merge pull request #3947 from kived/sdl2-poll-release-gil

release gil when polling for sdl events
This commit is contained in:
Mathieu Virbel 2016-01-27 21:47:50 +01:00
commit c7b0b20be4
2 changed files with 5 additions and 2 deletions

View File

@ -238,8 +238,11 @@ cdef class _WindowSDL2Storage:
def poll(self):
cdef SDL_Event event
cdef int rv
if SDL_PollEvent(&event) == 0:
with nogil:
rv = SDL_PollEvent(&event)
if rv == 0:
return False
action = None

View File

@ -467,7 +467,7 @@ cdef extern from "SDL.h":
cdef Uint32 SDL_GetTicks()
cdef void SDL_Delay(Uint32 ms) nogil
cdef Uint8 SDL_EventState(Uint32 type, int state)
cdef int SDL_PollEvent(SDL_Event * event)
cdef int SDL_PollEvent(SDL_Event * event) nogil
cdef void SDL_SetEventFilter(SDL_EventFilter *filter, void* userdata)
cdef SDL_RWops * SDL_RWFromFile(char *file, char *mode)
cdef SDL_RWops * SDL_RWFromMem(void *mem, int size)