diff options
author | Thomas Martitz <kugel@rockbox.org> | 2011-02-18 22:46:01 +0000 |
---|---|---|
committer | Thomas Martitz <kugel@rockbox.org> | 2011-02-18 22:46:01 +0000 |
commit | 6d85de341928aef8178465c60122f3cbe76f5dd6 (patch) | |
tree | ff86c384a574ac20d3418c1b904ed4d0de1f6980 /uisimulator/common/io.c | |
parent | 3926c30705cc7235122e2f2e35ab506b53238cdf (diff) | |
download | rockbox-6d85de341928aef8178465c60122f3cbe76f5dd6.tar.gz rockbox-6d85de341928aef8178465c60122f3cbe76f5dd6.zip |
Implement cooperative threads on hosted platforms using C code.
This replaces SDL threads with real cooperative threads, which are less cpu intensive and allow priority scheduling.
The backend for context switching is dependant on the host (sigaltstack/longjmp on Unix, Fibers on Windows).
configure has options to force or disallow SDL threads.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29327 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'uisimulator/common/io.c')
-rw-r--r-- | uisimulator/common/io.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/uisimulator/common/io.c b/uisimulator/common/io.c index f77180dc21..0d680e0e8a 100644 --- a/uisimulator/common/io.c +++ b/uisimulator/common/io.c | |||
@@ -46,9 +46,12 @@ | |||
46 | #endif | 46 | #endif |
47 | 47 | ||
48 | #include <fcntl.h> | 48 | #include <fcntl.h> |
49 | #include <SDL.h> | 49 | #ifdef HAVE_SDL_THREADS |
50 | #include <SDL_thread.h> | ||
51 | #include "thread-sdl.h" | 50 | #include "thread-sdl.h" |
51 | #else | ||
52 | #define sim_thread_unlock() NULL | ||
53 | #define sim_thread_lock(a) | ||
54 | #endif | ||
52 | #include "thread.h" | 55 | #include "thread.h" |
53 | #include "kernel.h" | 56 | #include "kernel.h" |
54 | #include "debug.h" | 57 | #include "debug.h" |