This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
Re: [PATCH, newlib] Allow locking routine to be retargeted
- From: Freddie Chopin <freddie_chopin at op dot pl>
- To: newlib at sourceware dot org
- Date: Thu, 10 Nov 2016 16:33:51 +0100
- Subject: Re: [PATCH, newlib] Allow locking routine to be retargeted
- Authentication-results: sourceware.org; auth=none
- References: <ce22a6fb-67bb-c1b2-78ea-669bd840ad67@foss.arm.com>
Hi Thomas!
Why don't you do the same thing for recursive functions? At least the
lock used by malloc() has to be recursive, so with your patch exactly
all mutexes should be recursive too.
I have doubts about practical implementation of these functions for any
RTOS, because of the __LOCK_INIT() macro used for initialization. In
every retargeted function you'll have to start critical section (most
likely by disabling interrupts) to initialize the object on heap, but
then how would you use heap if malloc()'s lock is used via these
functions too?
Regards,
FCh