comparison src/thread/pthread/SDL_systhread.c @ 1459:1e8582152d44

Date: Wed, 01 Mar 2006 10:14:31 +0000 From: "alan buckley" Subject: Re: Updating SDL for RISC OS I've attached a zip file with three diffs to get SDL to build on RISC OS. configure.in.diff and makedeps.sh.diff have been modified so that they can build the assembler file in video/riscos. You may want to double check these as I don't know a lot about unix shell programming. (I've tested them cross-compiling on cygwin). sdlsysthread.diff is the changes required to SDL_systhread.c for RISC OS. As you suspected with these changes in place you can delete the RISC OS specific threading code in thread/riscos. I've also renamed SDL_riscosASM.s to SDL_riscosASM.S, but I'm never quite sure how to rename files in CVS, so if you could to this it would be appreciated.
author Sam Lantinga <slouken@libsdl.org>
date Thu, 02 Mar 2006 03:24:20 +0000
parents d910939febfa
children 782fd950bd46 c121d94672cb a1b03ba2fcd0
comparison
equal deleted inserted replaced
1458:bf8db2d92be1 1459:1e8582152d44
32 static int sig_list[] = { 32 static int sig_list[] = {
33 SIGHUP, SIGINT, SIGQUIT, SIGPIPE, SIGALRM, SIGTERM, SIGCHLD, SIGWINCH, 33 SIGHUP, SIGINT, SIGQUIT, SIGPIPE, SIGALRM, SIGTERM, SIGCHLD, SIGWINCH,
34 SIGVTALRM, SIGPROF, 0 34 SIGVTALRM, SIGPROF, 0
35 }; 35 };
36 36
37 #ifdef __RISCOS__
38 /* RISC OS needs to know the main thread for
39 * it's timer and event processing. */
40 int riscos_using_threads = 0;
41 Uint32 riscos_main_thread = 0; /* Thread running events */
42 #endif
43
37 44
38 static void *RunThread(void *data) 45 static void *RunThread(void *data)
39 { 46 {
40 SDL_RunThread(data); 47 SDL_RunThread(data);
41 pthread_exit((void*)0); 48 pthread_exit((void*)0);
56 /* Create the thread and go! */ 63 /* Create the thread and go! */
57 if ( pthread_create(&thread->handle, &type, RunThread, args) != 0 ) { 64 if ( pthread_create(&thread->handle, &type, RunThread, args) != 0 ) {
58 SDL_SetError("Not enough resources to create thread"); 65 SDL_SetError("Not enough resources to create thread");
59 return(-1); 66 return(-1);
60 } 67 }
68
69 #ifdef __RISCOS__
70 if (riscos_using_threads == 0) {
71 riscos_using_threads = 1;
72 riscos_main_thread = SDL_ThreadID();
73 }
74 #endif
75
61 return(0); 76 return(0);
62 } 77 }
63 78
64 void SDL_SYS_SetupThread(void) 79 void SDL_SYS_SetupThread(void)
65 { 80 {