I want to make calls through newlib from my tasks thread safe and reentrant - it seems like I need to let each task have its own reent structure, and have the scheduler re-point the impure_ptr to this struct each context switch. Has anyone done this in freertos, or have any idea on how it can be done?
Yes this is quite a common thing to do. You can do it quite easily by modifying the tasks.c file, but even that is not necessary. Instead you can create a reent structure for each task and use the traceTASK_SWITCHED_IN macro to assign impure_ptr to the correct structure on each context switch.