From 9e37d7016344f0968fcb8812cf6f6b92e631fb32 Mon Sep 17 00:00:00 2001 From: goldsimon Date: Sun, 7 Mar 2010 16:50:08 +0000 Subject: [PATCH] Create mem_mutext at the end of mem_init. This enables sys_mutex_new to use the heap if required. --- src/core/mem.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/core/mem.c b/src/core/mem.c index b013c78f..e0fa598e 100644 --- a/src/core/mem.c +++ b/src/core/mem.c @@ -288,14 +288,14 @@ mem_init(void) ram_end->next = MEM_SIZE_ALIGNED; ram_end->prev = MEM_SIZE_ALIGNED; - if(sys_mutex_new(&mem_mutex) != ERR_OK) { - LWIP_ASSERT("failed to create mem_mutex", 0); - } - /* initialize the lowest-free pointer to the start of the heap */ lfree = (struct mem *)ram; MEM_STATS_AVAIL(avail, MEM_SIZE_ALIGNED); + + if(sys_mutex_new(&mem_mutex) != ERR_OK) { + LWIP_ASSERT("failed to create mem_mutex", 0); + } } /**