MFC rev. 1.18-1.21  - Fix thread safety.  - Make some optimizations.
MFC rev. 1.18-1.21
 - Fix thread safety.
 - Make some optimizations.

Approved by:	re (kensmith)

jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase