In versions 4 and 5 of the C-library, approximately half the routines were reentrant. What is the current status? Will some functions ( such as the memory allocation routines ) never be reentrant? [Note: I know I can bracket non-reentrant routines with a semaphore.]
If you just want to protect a library function like puts from reentrancy, you can create the following:
void R_puts (unsigned char *p) { os_wait( K_MBX + SEM_PUTS, 255, 0 ) puts(p); os_send_token(SEM_PUTS); }
void func (void) { R_puts("This is great."); R_puts("This is great, 2."); R_puts("This is great, 3."); }