Skip to content

Commit

Permalink
Ensure pthread_create works correctly.
Browse files Browse the repository at this point in the history
  • Loading branch information
rampant1018 committed Dec 30, 2014
1 parent 70c90e2 commit 8588ea8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
2 changes: 0 additions & 2 deletions user/apps/build.mk
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
# found in the LICENSE file.

user-apps-dirs = \
l4test \
posixtest \
pingpong \

ifdef CONFIG_BOARD_STM32F429DISCOVERY
user-apps-dirs += \
Expand Down
10 changes: 4 additions & 6 deletions user/apps/posixtest/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
/* posix layer */
#include <libposix/pthread.h>

#define STACK_SIZE 256
#define STACK_SIZE 512

__USER_DATA pthread_mutex_t mutex;

Expand Down Expand Up @@ -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));
Expand All @@ -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;
Expand All @@ -60,12 +57,13 @@ static __USER_TEXT void main(user_struct *user)
while(1)
L4_Sleep(L4_Never);

return;
return NULL;
}

DECLARE_USER(
255,
posixtest,
main,
DECLARE_FPAGE(0x0, 4 * (UTCB_SIZE + STACK_SIZE))
DECLARE_FPAGE(0x0, 512)
);

0 comments on commit 8588ea8

Please sign in to comment.