MFC r284178: Add barriers when updating and reading th_generation.
MFC r284178:
Add barriers when updating and reading th_generation.

MFC r284256:
Tweaks for r284178.

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