Address data race in ThreadPool (#1265)
Address data race in ThreadPool (#1265)

ThreadSanitizer detects some data race in ThreadPool. They stem from
inappropriate usage of volatile which are replaced with std::atomic
variables in this patch.

This patch focuses on data races identified while running the
math_brute_force component. For example, it doesn't fully remove usage
of ThreadPool_AtomicAdd from other components of the CTS. Furthermore,
thread leaks, most likely because threads are not joined, are not
addressed.

Signed-off-by: Marco Antognini <22c7c6a125704d89f5288f7df787c63bc5928de6@arm.com>
KhronosGroup/OpenCL-CTS,KhronosGroup/OpenCL-CTS,KhronosGroup/OpenCL-CTS,KhronosGroup/OpenCL-CTS