The changed thread code may not wish to save the old context under
certain circumstances but thread-unix.c assumed it would, cached it
and used it unconditionally.
Also, prevent it from leaking away all the jump buffers (old problem).
Creating and removing threads would eventually run it out of buffers
and then it would crash after that. Plugins, like Pictureflow, which
have worker threads could only be started a few times. Implement a
simple O(1) allocator that will reuse them and stays self-contained
to its own types (as it appears the original author intended).
Change-Id: Icf65413c086b346fb79bf827102b725269e2812c
This dir is suitable for stuff that doesn't fit the target tree, e.g. because
it also builds on hosted or otherwise. It also has a generic subfolder for
fallback C implementations so that not all archs need to provide asm files.
SOURCES should only contain "foo.c" where foo.c includes the specific
<arch>/foo.c files from the subdirs using the preprocessor. This way automatic
selection of asm versions or generic C verion is possible.
For the start, the thread support files are moved, since ASM threads can
be used on hosted platforms as well. Since core_sleep() remains platform
specific it's moved to the corresponding system.h headers.
Change-Id: Iebff272f3407a6eaafeb7656ceb0ae9eca3f7cb9
2012-01-22 18:46:44 +01:00
Renamed from firmware/target/hosted/thread-unix.c (Browse further)