Add lock around compiling (#871)
Add lock around compiling (#871)

The compiler tries to compile the same source multiple times and more
importantly write out to the same filename. Adding a lock to prevent
simultaneous compilation solves this issue. This is particularly
noticeable in integer_ops testing when using offline compilation,
but just in case, hold the lock for the entire program creation.

Signed-off-by: Mats Petersson <eca7d976a818c7624ce1412b55f124683e151088@arm.com>
Signed-off-by: Stuart Brady <5927b716ca6102ab3dc7740efab72ff15951354e@arm.com>
KhronosGroup/OpenCL-CTS,KhronosGroup/OpenCL-CTS,KhronosGroup/OpenCL-CTS,KhronosGroup/OpenCL-CTS