Make concurrently accessed globals atomic

Eliminate data races on gHaveTLS, and gShutdown by declaring them as
atomic. Use explicit load() and store() operations to access them.

Note that gHaveTLS requires memory ordering guarantees, and thus,
even with a cooperative compiler, the old code would never have been
compiled to correct ARM object code.

Bug: 36697681
Test: Boot AOSP, TreeHugger
Change-Id: I60b95b9483940e37e97cb522fbbf403d3dc75374
1 file changed