diff options
| author | prife <[email protected]> | 2013-01-22 23:51:13 +0800 |
|---|---|---|
| committer | prife <[email protected]> | 2013-01-22 23:51:13 +0800 |
| commit | d7f8f375df4771045ffa13f9252ad1b25786a4ae (patch) | |
| tree | 5c5dfaca5b30d97800956b5fbc3f0b59dd594ed2 | |
| parent | f5fea40c5e615eab5bdb4176398ea6101bdfbf5b (diff) | |
just mask signal in sdl_fb.c
| -rwxr-xr-x | bsp/simulator/drivers/sdl_fb.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/bsp/simulator/drivers/sdl_fb.c b/bsp/simulator/drivers/sdl_fb.c index 752a6fb93c..714d263ba0 100755 --- a/bsp/simulator/drivers/sdl_fb.c +++ b/bsp/simulator/drivers/sdl_fb.c @@ -141,6 +141,7 @@ static void sdlfb_hw_init(void) #include <mmsystem.h> #else #include <pthread.h> +#include <signal.h> #endif #include <stdio.h> @@ -158,8 +159,15 @@ static void *sdl_loop(void *lpParam) int quit = 0; SDL_Event event; int button_state = 0; - 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(); device = rt_device_find("sdl"); @@ -315,14 +323,14 @@ void rt_hw_sdl_start(void) } ResumeThread(thread); #else - /* Linux */ - pthread_t pid; + /* Linux */ + pthread_t pid; int res; res = pthread_create(&pid, NULL, &sdl_loop, NULL); if (res) { printf("pthread create sdl thread faild, <%d>\n", res); exit(EXIT_FAILURE); - } + } #endif } |
