Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of lwip-sys by
Diff: arch/sys_arch.c
- Revision:
- 5:5ca31173e0aa
- Parent:
- 4:dd37867293e7
- Child:
- 6:2ace1ff71ae6
--- a/arch/sys_arch.c Fri Jul 06 08:55:22 2012 +0000 +++ b/arch/sys_arch.c Mon Jul 16 14:46:19 2012 +0000 @@ -443,8 +443,12 @@ #ifdef CMSIS_OS_RTX t->def.pthread = (os_pthread)thread; t->def.tpriority = (osPriority)priority; - t->def.instances = 1; t->def.stacksize = stacksize; + t->def.stack_pointer = (unsigned char*) malloc(stacksize); //Note DG: I don't think that malloc is always thread-safe, this could lead to memory corruption in some cases + if (t->def.stack_pointer == NULL) + { + error("Error allocating the stack memory"); + } #endif t->id = osThreadCreate(&t->def, arg); if (t->id == NULL)