summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Chapman <dave@dchapman.com>2007-03-24 01:27:29 +0000
committerDave Chapman <dave@dchapman.com>2007-03-24 01:27:29 +0000
commit467651ae763107d478799586a1061693cafe6dab (patch)
tree9c65e8bf3ac593acc184e10ba2f1fa44cc153b53
parent5242cff2b8a1d0060866f4db6f8e3d8257fbc831 (diff)
Make the sim create_thread() function slightly closer to the real thing. #include "thread.h" in thread-sdl.c to ensure function prototypes are consistent. This now allows mpegplayer to run in the sim.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12901 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--uisimulator/sdl/thread-sdl.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/uisimulator/sdl/thread-sdl.c b/uisimulator/sdl/thread-sdl.c
index 21697699a5..809897da01 100644
--- a/uisimulator/sdl/thread-sdl.c
+++ b/uisimulator/sdl/thread-sdl.c
@@ -23,6 +23,7 @@
#include <stdlib.h>
#include "thread-sdl.h"
#include "kernel.h"
+#include "thread.h"
#include "debug.h"
SDL_Thread *threads[256];
@@ -58,21 +59,29 @@ int runthread(void *data)
return 0;
}
-int create_thread(void (*fp)(void), void* sp, int stk_size)
+struct thread_entry*
+ create_thread(void (*function)(void), void* stack, int stack_size,
+ const char *name)
{
/** Avoid compiler warnings */
- (void)sp;
- (void)stk_size;
+ (void)stack;
+ (void)stack_size;
+ (void)name;
+ SDL_Thread* t;
if (threadCount == 256) {
- return -1;
+ return NULL;
}
- threads[threadCount++] = SDL_CreateThread(runthread, fp);
+ t = SDL_CreateThread(runthread, function);
+ threads[threadCount++] = t;
yield();
- return 0;
+ /* The return value is never de-referenced outside thread.c so this
+ nastiness should be fine. However, a better solution would be nice.
+ */
+ return (struct thread_entry*)t;
}
void init_threads(void)