chromium/third_party/pthreadpool/src/src/threadpool-common.h

#pragma once

#ifndef PTHREADPOOL_USE_CPUINFO
	#define PTHREADPOOL_USE_CPUINFO
#endif

#ifndef PTHREADPOOL_USE_FUTEX
	#if defined(__linux__)
		#define PTHREADPOOL_USE_FUTEX
	#elif defined(__EMSCRIPTEN__)
		#define PTHREADPOOL_USE_FUTEX
	#else
		#define PTHREADPOOL_USE_FUTEX
	#endif
#endif

#ifndef PTHREADPOOL_USE_GCD
	#if defined(__APPLE__)
		#define PTHREADPOOL_USE_GCD
	#else
		#define PTHREADPOOL_USE_GCD
	#endif
#endif

#ifndef PTHREADPOOL_USE_EVENT
	#if defined(_WIN32) || defined(__CYGWIN__)
		#define PTHREADPOOL_USE_EVENT
	#else
		#define PTHREADPOOL_USE_EVENT
	#endif
#endif

#ifndef PTHREADPOOL_USE_CONDVAR
	#if PTHREADPOOL_USE_GCD || PTHREADPOOL_USE_FUTEX || PTHREADPOOL_USE_EVENT
		#define PTHREADPOOL_USE_CONDVAR
	#else
		#define PTHREADPOOL_USE_CONDVAR
	#endif
#endif


/* Number of iterations in spin-wait loop before going into futex/condvar wait */
#define PTHREADPOOL_SPIN_WAIT_ITERATIONS

#define PTHREADPOOL_CACHELINE_SIZE
#if defined(__GNUC__)
	#define PTHREADPOOL_CACHELINE_ALIGNED
#elif defined(_MSC_VER)
	#define PTHREADPOOL_CACHELINE_ALIGNED
#else
	#error "Platform-specific implementation of PTHREADPOOL_CACHELINE_ALIGNED required"
#endif

#if defined(__clang__)
	#if __has_extension(c_static_assert) || __has_feature(c_static_assert)
		#define PTHREADPOOL_STATIC_ASSERT(predicate, message)
	#else
		#define PTHREADPOOL_STATIC_ASSERT
	#endif
#elif defined(__GNUC__) && ((__GNUC__ > 4) || (__GNUC__ == 4) && (__GNUC_MINOR__ >= 6))
	/* Static assert is supported by gcc >= 4.6 */
	#define PTHREADPOOL_STATIC_ASSERT
#else
	#define PTHREADPOOL_STATIC_ASSERT
#endif

#ifndef PTHREADPOOL_INTERNAL
	#if defined(__ELF__)
		#define PTHREADPOOL_INTERNAL
	#elif defined(__MACH__)
		#define PTHREADPOOL_INTERNAL
	#else
		#define PTHREADPOOL_INTERNAL
	#endif
#endif