[Title] protect SDL_PollEvent
authorgiwoong.kim <giwoong.kim@samsung.com>
Mon, 19 Mar 2012 09:03:47 +0000 (18:03 +0900)
committergiwoong.kim <giwoong.kim@samsung.com>
Mon, 19 Mar 2012 09:03:47 +0000 (18:03 +0900)
[Type]
[Module]
[Priority]
[Jira#]
[Redmine#]
[Problem]
[Cause]
[Solution]
[TestCase]

tizen/src/maru_sdl.c

index ba482b6..9ba2eda 100644 (file)
@@ -133,13 +133,24 @@ static void qemu_ds_resize(DisplayState *ds)
 
 }
 
+static int maru_sdl_poll_event(SDL_Event *ev)
+{
+    int ret = 0;
+
+    pthread_mutex_lock(&sdl_mutex);
+    ret = SDL_PollEvent(ev);
+    pthread_mutex_unlock(&sdl_mutex);
+
+    return ret;
+}
+
 static void qemu_ds_refresh(DisplayState *ds)
 {
     SDL_Event ev1, *ev = &ev1;
 
     vga_hw_update();
 
-    while (SDL_PollEvent(ev)) {
+    while (maru_sdl_poll_event(ev)) {
         switch (ev->type) {
             case SDL_VIDEORESIZE:
             {