summaryrefslogtreecommitdiff
path: root/firmware/target/hosted/sdl/thread-sdl.h
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 /firmware/target/hosted/sdl/thread-sdl.h
parent3926c30705cc7235122e2f2e35ab506b53238cdf (diff)
downloadrockbox-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 'firmware/target/hosted/sdl/thread-sdl.h')
-rw-r--r--firmware/target/hosted/sdl/thread-sdl.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/firmware/target/hosted/sdl/thread-sdl.h b/firmware/target/hosted/sdl/thread-sdl.h
index 9384e6060d..9edb3ee74e 100644
--- a/firmware/target/hosted/sdl/thread-sdl.h
+++ b/firmware/target/hosted/sdl/thread-sdl.h
@@ -22,11 +22,13 @@
22#ifndef __THREADSDL_H__ 22#ifndef __THREADSDL_H__
23#define __THREADSDL_H__ 23#define __THREADSDL_H__
24 24
25#ifdef HAVE_SDL_THREADS
25/* extra thread functions that only apply when running on hosting platforms */ 26/* extra thread functions that only apply when running on hosting platforms */
26void sim_thread_lock(void *me); 27void sim_thread_lock(void *me);
27void * sim_thread_unlock(void); 28void * sim_thread_unlock(void);
28void sim_thread_exception_wait(void); 29void sim_thread_exception_wait(void);
29void sim_thread_shutdown(void); /* Shut down all kernel threads gracefully */ 30void sim_thread_shutdown(void); /* Shut down all kernel threads gracefully */
31#endif
30 32
31#endif /* #ifndef __THREADSDL_H__ */ 33#endif /* #ifndef __THREADSDL_H__ */
32 34