#include "src/base/SkSpinlock.h"
#include "include/private/base/SkFeatures.h"
#include "include/private/base/SkThreadAnnotations.h"
#if 0
#include "include/private/base/SkMutex.h"
#include <execinfo.h>
#include <stdio.h>
static void debug_trace() {
void* stack[64];
int len = backtrace(stack, std::size(stack));
static SkMutex lock;
{
SkAutoMutexExclusive locked(lock);
fprintf(stderr, "\n");
backtrace_symbols_fd(stack, len, 2);
fprintf(stderr, "\n");
}
}
#else
static void debug_trace() { … }
#endif
#if SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSE2
#include <emmintrin.h>
static void do_pause() { … }
#else
static void do_pause() { }
#endif
void SkSpinlock::contendedAcquire() { … }