#ifndef BASE_PROFILER_SAMPLING_PROFILER_THREAD_TOKEN_H_
#define BASE_PROFILER_SAMPLING_PROFILER_THREAD_TOKEN_H_
#include <optional>
#include "base/base_export.h"
#include "base/threading/platform_thread.h"
#include "build/build_config.h"
#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_APPLE)
#include <pthread.h>
#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
#include <stdint.h>
#endif
namespace base {
struct SamplingProfilerThreadToken {
PlatformThreadId id;
#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_APPLE)
pthread_t pthread_id;
#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_OHOS)
std::optional<uintptr_t> stack_base_address;
#endif
};
BASE_EXPORT SamplingProfilerThreadToken GetSamplingProfilerCurrentThreadToken();
}
#endif