Only use thread_local on aarch64 iOS build variants.

Versions of iOS < 9.0 do no have thread_local support and simulator build
variants emit an error about this (even though they are x86_64). This patch
flips the logic to only enable thread_local usage on aarch64 build variants.

Change-Id: I63294be4f9a2bdb3bcd6d49b213e9c3326f50a5b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/234020
Auto-Submit: Chinmay Garde <chinmaygarde@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
This commit is contained in:
Chinmay Garde 2019-08-12 13:39:54 -07:00 committed by Skia Commit-Bot
parent b875cc709c
commit 5b2f04c419

View File

@ -44,9 +44,10 @@ namespace {
}
static SkLRUCache<Key, skvm::Program>* try_acquire_program_cache() {
#if defined(SK_BUILD_FOR_IOS) && defined(__arm)
// Some troublemaker build configurations (so far {Flutter,G3}/iOS/armv7) don't
// support thread_local. We could use an SkSpinlock and tryAcquire()/release(), or...
#if defined(SK_BUILD_FOR_IOS)
// iOS doesn't support thread_local on versions less than 9.0. pthread
// based fallbacks must be used there. We could also use an SkSpinlock
// and tryAcquire()/release(), or...
return nullptr; // ... we could just not cache programs on those platforms.
#else
thread_local static auto* cache = new SkLRUCache<Key, skvm::Program>{8};