comparison src/thread/beos/SDL_systhread.c @ 1668:4da1ee79c9af SDL-1.3

more tweaking indent options
author Sam Lantinga <slouken@libsdl.org>
date Mon, 29 May 2006 04:04:35 +0000
parents 782fd950bd46
children
comparison
equal deleted inserted replaced
1667:1fddae038bc8 1668:4da1ee79c9af
36 static int sig_list[] = { 36 static int sig_list[] = {
37 SIGHUP, SIGINT, SIGQUIT, SIGPIPE, SIGALRM, SIGTERM, SIGWINCH, 0 37 SIGHUP, SIGINT, SIGQUIT, SIGPIPE, SIGALRM, SIGTERM, SIGWINCH, 0
38 }; 38 };
39 39
40 void 40 void
41 SDL_MaskSignals (sigset_t * omask) 41 SDL_MaskSignals(sigset_t * omask)
42 { 42 {
43 sigset_t mask; 43 sigset_t mask;
44 int i; 44 int i;
45 45
46 sigemptyset (&mask); 46 sigemptyset(&mask);
47 for (i = 0; sig_list[i]; ++i) { 47 for (i = 0; sig_list[i]; ++i) {
48 sigaddset (&mask, sig_list[i]); 48 sigaddset(&mask, sig_list[i]);
49 } 49 }
50 sigprocmask (SIG_BLOCK, &mask, omask); 50 sigprocmask(SIG_BLOCK, &mask, omask);
51 } 51 }
52 52
53 void 53 void
54 SDL_UnmaskSignals (sigset_t * omask) 54 SDL_UnmaskSignals(sigset_t * omask)
55 { 55 {
56 sigprocmask (SIG_SETMASK, omask, NULL); 56 sigprocmask(SIG_SETMASK, omask, NULL);
57 } 57 }
58 58
59 static int32 59 static int32
60 RunThread (void *data) 60 RunThread(void *data)
61 { 61 {
62 SDL_RunThread (data); 62 SDL_RunThread(data);
63 return (0); 63 return (0);
64 } 64 }
65 65
66 int 66 int
67 SDL_SYS_CreateThread (SDL_Thread * thread, void *args) 67 SDL_SYS_CreateThread(SDL_Thread * thread, void *args)
68 { 68 {
69 /* Create the thread and go! */ 69 /* Create the thread and go! */
70 thread->handle = spawn_thread (RunThread, "SDL", B_NORMAL_PRIORITY, args); 70 thread->handle = spawn_thread(RunThread, "SDL", B_NORMAL_PRIORITY, args);
71 if ((thread->handle == B_NO_MORE_THREADS) || 71 if ((thread->handle == B_NO_MORE_THREADS) ||
72 (thread->handle == B_NO_MEMORY)) { 72 (thread->handle == B_NO_MEMORY)) {
73 SDL_SetError ("Not enough resources to create thread"); 73 SDL_SetError("Not enough resources to create thread");
74 return (-1); 74 return (-1);
75 } 75 }
76 resume_thread (thread->handle); 76 resume_thread(thread->handle);
77 return (0); 77 return (0);
78 } 78 }
79 79
80 void 80 void
81 SDL_SYS_SetupThread (void) 81 SDL_SYS_SetupThread(void)
82 { 82 {
83 /* Mask asynchronous signals for this thread */ 83 /* Mask asynchronous signals for this thread */
84 SDL_MaskSignals (NULL); 84 SDL_MaskSignals(NULL);
85 } 85 }
86 86
87 Uint32 87 Uint32
88 SDL_ThreadID (void) 88 SDL_ThreadID(void)
89 { 89 {
90 return ((Uint32) find_thread (NULL)); 90 return ((Uint32) find_thread(NULL));
91 } 91 }
92 92
93 void 93 void
94 SDL_SYS_WaitThread (SDL_Thread * thread) 94 SDL_SYS_WaitThread(SDL_Thread * thread)
95 { 95 {
96 status_t the_status; 96 status_t the_status;
97 97
98 wait_for_thread (thread->handle, &the_status); 98 wait_for_thread(thread->handle, &the_status);
99 } 99 }
100 100
101 void 101 void
102 SDL_SYS_KillThread (SDL_Thread * thread) 102 SDL_SYS_KillThread(SDL_Thread * thread)
103 { 103 {
104 kill_thread (thread->handle); 104 kill_thread(thread->handle);
105 } 105 }
106 106
107 /* vi: set ts=4 sw=4 expandtab: */ 107 /* vi: set ts=4 sw=4 expandtab: */