comparison src/thread/irix/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
38 SIGVTALRM, SIGPROF, 0 38 SIGVTALRM, SIGPROF, 0
39 }; 39 };
40 40
41 41
42 int 42 int
43 SDL_SYS_CreateThread (SDL_Thread * thread, void *args) 43 SDL_SYS_CreateThread(SDL_Thread * thread, void *args)
44 { 44 {
45 /* Create the thread and go! */ 45 /* Create the thread and go! */
46 if (sproc (SDL_RunThread, PR_SALL, args) < 0) { 46 if (sproc(SDL_RunThread, PR_SALL, args) < 0) {
47 SDL_SetError ("Not enough resources to create thread"); 47 SDL_SetError("Not enough resources to create thread");
48 return (-1); 48 return (-1);
49 } 49 }
50 return (0); 50 return (0);
51 } 51 }
52 52
53 void 53 void
54 SDL_SYS_SetupThread (void) 54 SDL_SYS_SetupThread(void)
55 { 55 {
56 int i; 56 int i;
57 sigset_t mask; 57 sigset_t mask;
58 58
59 /* Mask asynchronous signals for this thread */ 59 /* Mask asynchronous signals for this thread */
60 sigemptyset (&mask); 60 sigemptyset(&mask);
61 for (i = 0; sig_list[i]; ++i) { 61 for (i = 0; sig_list[i]; ++i) {
62 sigaddset (&mask, sig_list[i]); 62 sigaddset(&mask, sig_list[i]);
63 } 63 }
64 sigprocmask (SIG_BLOCK, &mask, NULL); 64 sigprocmask(SIG_BLOCK, &mask, NULL);
65 } 65 }
66 66
67 /* WARNING: This may not work for systems with 64-bit pid_t */ 67 /* WARNING: This may not work for systems with 64-bit pid_t */
68 Uint32 68 Uint32
69 SDL_ThreadID (void) 69 SDL_ThreadID(void)
70 { 70 {
71 return ((Uint32) getpid ()); 71 return ((Uint32) getpid());
72 } 72 }
73 73
74 /* WARNING: This may not work for systems with 64-bit pid_t */ 74 /* WARNING: This may not work for systems with 64-bit pid_t */
75 void 75 void
76 SDL_WaitThread (SDL_Thread * thread, int *status) 76 SDL_WaitThread(SDL_Thread * thread, int *status)
77 { 77 {
78 errno = 0; 78 errno = 0;
79 while (errno != ECHILD) { 79 while (errno != ECHILD) {
80 waitpid (thread->handle, NULL, 0); 80 waitpid(thread->handle, NULL, 0);
81 } 81 }
82 } 82 }
83 83
84 /* WARNING: This may not work for systems with 64-bit pid_t */ 84 /* WARNING: This may not work for systems with 64-bit pid_t */
85 void 85 void
86 SDL_KillThread (SDL_Thread * thread) 86 SDL_KillThread(SDL_Thread * thread)
87 { 87 {
88 kill (thread->handle, SIGKILL); 88 kill(thread->handle, SIGKILL);
89 } 89 }
90 90
91 /* vi: set ts=4 sw=4 expandtab: */ 91 /* vi: set ts=4 sw=4 expandtab: */