From 8588ea8b63f27354bd1276a64111c97e5a40928e Mon Sep 17 00:00:00 2001 From: Jeff Liaw Date: Tue, 30 Dec 2014 15:52:51 +0800 Subject: [PATCH] Ensure pthread_create works correctly. --- user/apps/build.mk | 2 -- user/apps/posixtest/main.c | 10 ++++------ 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/user/apps/build.mk b/user/apps/build.mk index c21d4ab4..eaee7464 100644 --- a/user/apps/build.mk +++ b/user/apps/build.mk @@ -3,9 +3,7 @@ # found in the LICENSE file. user-apps-dirs = \ - l4test \ posixtest \ - pingpong \ ifdef CONFIG_BOARD_STM32F429DISCOVERY user-apps-dirs += \ diff --git a/user/apps/posixtest/main.c b/user/apps/posixtest/main.c index 9924a3eb..f42c6dae 100644 --- a/user/apps/posixtest/main.c +++ b/user/apps/posixtest/main.c @@ -7,7 +7,7 @@ /* posix layer */ #include -#define STACK_SIZE 256 +#define STACK_SIZE 512 __USER_DATA pthread_mutex_t mutex; @@ -36,9 +36,6 @@ __USER_TEXT void *child_thread1(void *args) L4_Sleep(L4_TimePeriod(500)); } - printf("task 1: suicide\n"); - pthread_exit(0); - for(int i = 0; i <= 10; i++) { printf("%d\n", 10 - i); L4_Sleep(L4_TimePeriod(500)); @@ -51,7 +48,7 @@ __USER_TEXT void *child_thread1(void *args) return 0; } -static __USER_TEXT void main(user_struct *user) +static __USER_TEXT void *main(void *user) { printf("\nPosix Layer test starts\n"); mutex = 0; @@ -60,7 +57,7 @@ static __USER_TEXT void main(user_struct *user) while(1) L4_Sleep(L4_Never); - return; + return NULL; } DECLARE_USER( @@ -68,4 +65,5 @@ DECLARE_USER( posixtest, main, DECLARE_FPAGE(0x0, 4 * (UTCB_SIZE + STACK_SIZE)) + DECLARE_FPAGE(0x0, 512) );