Mercurial > sdl-ios-xcode
comparison src/thread/amigaos/SDL_systhread.c @ 21:75a95f82bc1f
Updated the Amiga OS port of SDL (thanks Gabriele)
author | Sam Lantinga <slouken@lokigames.com> |
---|---|
date | Thu, 10 May 2001 20:13:29 +0000 |
parents | 74212992fb08 |
children | e8157fcb3114 |
comparison
equal
deleted
inserted
replaced
20:3dc008dc229d | 21:75a95f82bc1f |
---|---|
23 #ifdef SAVE_RCSID | 23 #ifdef SAVE_RCSID |
24 static char rcsid = | 24 static char rcsid = |
25 "@(#) $Id$"; | 25 "@(#) $Id$"; |
26 #endif | 26 #endif |
27 | 27 |
28 /* AmigaOS thread management routines for SDL */ | 28 /* BeOS thread management routines for SDL */ |
29 | 29 |
30 #include "SDL_error.h" | 30 #include "SDL_error.h" |
31 #include "SDL_mutex.h" | 31 #include "SDL_mutex.h" |
32 #include "SDL_thread.h" | 32 #include "SDL_thread.h" |
33 #include "SDL_thread_c.h" | 33 #include "SDL_thread_c.h" |
37 int (*func)(void *); | 37 int (*func)(void *); |
38 void *data; | 38 void *data; |
39 SDL_Thread *info; | 39 SDL_Thread *info; |
40 struct Task *wait; | 40 struct Task *wait; |
41 } thread_args; | 41 } thread_args; |
42 | |
43 #ifndef MORPHOS | |
42 | 44 |
43 #if defined(__SASC) && !defined(__PPC__) | 45 #if defined(__SASC) && !defined(__PPC__) |
44 __saveds __asm Uint32 RunThread(register __a0 char *args ) | 46 __saveds __asm Uint32 RunThread(register __a0 char *args ) |
45 #elif defined(__PPC__) | 47 #elif defined(__PPC__) |
46 Uint32 RunThread(char *args) | 48 Uint32 RunThread(char *args) |
57 SDL_RunThread(data); | 59 SDL_RunThread(data); |
58 | 60 |
59 Signal(Father,SIGBREAKF_CTRL_F); | 61 Signal(Father,SIGBREAKF_CTRL_F); |
60 return(0); | 62 return(0); |
61 } | 63 } |
64 | |
65 #else | |
66 | |
67 #include <emul/emulinterface.h> | |
68 | |
69 Uint32 RunTheThread(void) | |
70 { | |
71 thread_args *data=(thread_args *)atol(REG_A0); | |
72 struct Task *Father; | |
73 | |
74 D(bug("Received data: %lx\n",data)); | |
75 Father=data->wait; | |
76 | |
77 SDL_RunThread(data); | |
78 | |
79 Signal(Father,SIGBREAKF_CTRL_F); | |
80 return(0); | |
81 } | |
82 | |
83 struct EmulLibEntry RunThread= | |
84 { | |
85 TRAP_LIB, | |
86 0, | |
87 RunTheThread | |
88 }; | |
89 | |
90 #endif | |
91 | |
62 | 92 |
63 int SDL_SYS_CreateThread(SDL_Thread *thread, void *args) | 93 int SDL_SYS_CreateThread(SDL_Thread *thread, void *args) |
64 { | 94 { |
65 /* Create the thread and go! */ | 95 /* Create the thread and go! */ |
66 char buffer[20]; | 96 char buffer[20]; |
96 return((Uint32)FindTask(NULL)); | 126 return((Uint32)FindTask(NULL)); |
97 } | 127 } |
98 | 128 |
99 void SDL_SYS_WaitThread(SDL_Thread *thread) | 129 void SDL_SYS_WaitThread(SDL_Thread *thread) |
100 { | 130 { |
131 SetSignal(0L,SIGBREAKF_CTRL_F|SIGBREAKF_CTRL_C); | |
101 Wait(SIGBREAKF_CTRL_F|SIGBREAKF_CTRL_C); | 132 Wait(SIGBREAKF_CTRL_F|SIGBREAKF_CTRL_C); |
102 } | 133 } |
103 | 134 |
104 void SDL_SYS_KillThread(SDL_Thread *thread) | 135 void SDL_SYS_KillThread(SDL_Thread *thread) |
105 { | 136 { |