From aba6ed4b91aff5d914be11704e34de75bfd4d003 Mon Sep 17 00:00:00 2001 From: Alexis211 Date: Fri, 10 Sep 2010 18:46:00 +0200 Subject: Each thread has its own stack. Added simple unit tests for kmalloc,kfree Found a bug in heap_contract (not sure) but didn't fix it. --- src/modules/test/main.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/modules/test') diff --git a/src/modules/test/main.c b/src/modules/test/main.c index 507567f..493867e 100644 --- a/src/modules/test/main.c +++ b/src/modules/test/main.c @@ -30,6 +30,12 @@ void thread2(void* d) { } } +void thread_cascade(void* d) { + c_logSvc("{#} Thread cascade element started. Continuing.", LL_STATUS); + thread_new(thread_cascade, (void*)((int)d - 1)); + c_logSvc("{#} Thread cascade element finished.", LL_STATUS); +} + int main() { c_logSvc("Hi world from unregistered test module !", LL_NOTICE); c_registerSvc("test"); @@ -38,6 +44,9 @@ int main() { c_logSvc("{1} Sending a test message to manager", LL_STATUS); c_nothing(1, 0); + c_logSvc("{1} Creating thread cascade len:3", LL_STATUS); + thread_new(thread_cascade, (void*)3); + c_logSvc("{1} Thread now sleeping...", LL_WARNING); while (1) thread_sleep(1000); return 0; -- cgit v1.2.3