User`s manual

82 digi.com Multitasking with Dynamic C
5.10.3 Library Reentrancy
When writing a µC/OS-II application, it is important to know which Dynamic C library functions are non-
reentrant. If a function is non-reentrant, then only one task may access the function at a time, and access to
the function should be controlled with a µC/OS-II semaphore. The following is a list of Dynamic C func-
tions that are non-reentrant.
The Dynamic C serial port functions (RS232.LIB functions) should be used in a restricted manner with
µC/OS-II. Two tasks can use the same port as long as both are not reading, or both are not writing; i.e., one
task can read from serial port X and another task can write to serial port X at the same time without con-
flict.
Table 5-3. Dynamic C Non-Reentrant Functions
Library Non-Reentrant Functions
MATH.LIB randg, randb, rand
RS232.LIB All
RTCLOCK.LIB write_rtc, tm_wr
STDIO.LIB kbhit, getchar, gets, getswf, selectkey
STRING.LIB
atof
a
, atoi1, strtok
a. reentrant but sets the global _xtoxErr flag
SYS.LIB
clockDoublerOn, clockDoublerOff,
useMainOsc, useClockDivider, use32kHzOsc
VDRIVER.LIB VdGetFreeWd, VdReleaseWd
XMEM.LIB WriteFlash
JRIO.LIB
digOut, digOn, digOff, jrioInit, anaIn,
anaOut, cof_anaIn
JR485.LIB All