提交 d7f8f375 编写于 作者: P prife

just mask signal in sdl_fb.c

上级 f5fea40c
...@@ -141,6 +141,7 @@ static void sdlfb_hw_init(void) ...@@ -141,6 +141,7 @@ static void sdlfb_hw_init(void)
#include <mmsystem.h> #include <mmsystem.h>
#else #else
#include <pthread.h> #include <pthread.h>
#include <signal.h>
#endif #endif
#include <stdio.h> #include <stdio.h>
...@@ -158,8 +159,15 @@ static void *sdl_loop(void *lpParam) ...@@ -158,8 +159,15 @@ static void *sdl_loop(void *lpParam)
int quit = 0; int quit = 0;
SDL_Event event; SDL_Event event;
int button_state = 0; int button_state = 0;
rt_device_t device; rt_device_t device;
#ifndef _WIN32
sigset_t sigmask, oldmask;
/* set the getchar without buffer */
sigfillset(&sigmask);
pthread_sigmask(SIG_BLOCK, &sigmask, &oldmask);
#endif
sdlfb_hw_init(); sdlfb_hw_init();
device = rt_device_find("sdl"); device = rt_device_find("sdl");
...@@ -315,14 +323,14 @@ void rt_hw_sdl_start(void) ...@@ -315,14 +323,14 @@ void rt_hw_sdl_start(void)
} }
ResumeThread(thread); ResumeThread(thread);
#else #else
/* Linux */ /* Linux */
pthread_t pid; pthread_t pid;
int res; int res;
res = pthread_create(&pid, NULL, &sdl_loop, NULL); res = pthread_create(&pid, NULL, &sdl_loop, NULL);
if (res) if (res)
{ {
printf("pthread create sdl thread faild, <%d>\n", res); printf("pthread create sdl thread faild, <%d>\n", res);
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
#endif #endif
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册