[colorlcd] make malloc() thread-safe

This commit is contained in:
Raphael Coeffic
2021-10-04 21:52:08 +11:00
committed by Peter Feerick
parent 6c74af974c
commit 6684489f01
3 changed files with 24 additions and 0 deletions
+18
View File
@@ -45,6 +45,24 @@ extern caddr_t _sbrk(int nbytes)
}
}
#if defined(THREADSAFE_MALLOC) && !defined(BOOT)
#include <FreeRTOS.h>
#include <task.h>
void __malloc_lock(struct _reent *r)
{
(void)(r);
vTaskSuspendAll();
};
void __malloc_unlock(struct _reent *r)
{
(void)(r);
(void)xTaskResumeAll();
};
#endif
#if !defined(SEMIHOSTING)
extern int _gettimeofday(void *p1, void *p2)
{