summaryrefslogtreecommitdiff
path: root/uisimulator/common
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2011-02-18 22:46:01 +0000
committerThomas Martitz <kugel@rockbox.org>2011-02-18 22:46:01 +0000
commit6d85de341928aef8178465c60122f3cbe76f5dd6 (patch)
treeff86c384a574ac20d3418c1b904ed4d0de1f6980 /uisimulator/common
parent3926c30705cc7235122e2f2e35ab506b53238cdf (diff)
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')
-rw-r--r--uisimulator/common/io.c7
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 @@
#endif
#include <fcntl.h>
-#include <SDL.h>
-#include <SDL_thread.h>
+#ifdef HAVE_SDL_THREADS
#include "thread-sdl.h"
+#else
+#define sim_thread_unlock() NULL
+#define sim_thread_lock(a)
+#endif
#include "thread.h"
#include "kernel.h"
#include "debug.h"