File indexing completed on 2025-01-30 09:31:55
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 #ifndef ABSL_SYNCHRONIZATION_INTERNAL_WAITER_H_
0017 #define ABSL_SYNCHRONIZATION_INTERNAL_WAITER_H_
0018
0019 #include "absl/base/config.h"
0020 #include "absl/synchronization/internal/futex_waiter.h"
0021 #include "absl/synchronization/internal/pthread_waiter.h"
0022 #include "absl/synchronization/internal/sem_waiter.h"
0023 #include "absl/synchronization/internal/stdcpp_waiter.h"
0024 #include "absl/synchronization/internal/win32_waiter.h"
0025
0026
0027 #define ABSL_WAITER_MODE_FUTEX 0
0028 #define ABSL_WAITER_MODE_SEM 1
0029 #define ABSL_WAITER_MODE_CONDVAR 2
0030 #define ABSL_WAITER_MODE_WIN32 3
0031 #define ABSL_WAITER_MODE_STDCPP 4
0032
0033 #if defined(ABSL_FORCE_WAITER_MODE)
0034 #define ABSL_WAITER_MODE ABSL_FORCE_WAITER_MODE
0035 #elif defined(ABSL_INTERNAL_HAVE_WIN32_WAITER)
0036 #define ABSL_WAITER_MODE ABSL_WAITER_MODE_WIN32
0037 #elif defined(ABSL_INTERNAL_HAVE_FUTEX_WAITER)
0038 #define ABSL_WAITER_MODE ABSL_WAITER_MODE_FUTEX
0039 #elif defined(ABSL_INTERNAL_HAVE_SEM_WAITER)
0040 #define ABSL_WAITER_MODE ABSL_WAITER_MODE_SEM
0041 #elif defined(ABSL_INTERNAL_HAVE_PTHREAD_WAITER)
0042 #define ABSL_WAITER_MODE ABSL_WAITER_MODE_CONDVAR
0043 #elif defined(ABSL_INTERNAL_HAVE_STDCPP_WAITER)
0044 #define ABSL_WAITER_MODE ABSL_WAITER_MODE_STDCPP
0045 #else
0046 #error ABSL_WAITER_MODE is undefined
0047 #endif
0048
0049 namespace absl {
0050 ABSL_NAMESPACE_BEGIN
0051 namespace synchronization_internal {
0052
0053 #if ABSL_WAITER_MODE == ABSL_WAITER_MODE_FUTEX
0054 using Waiter = FutexWaiter;
0055 #elif ABSL_WAITER_MODE == ABSL_WAITER_MODE_SEM
0056 using Waiter = SemWaiter;
0057 #elif ABSL_WAITER_MODE == ABSL_WAITER_MODE_CONDVAR
0058 using Waiter = PthreadWaiter;
0059 #elif ABSL_WAITER_MODE == ABSL_WAITER_MODE_WIN32
0060 using Waiter = Win32Waiter;
0061 #elif ABSL_WAITER_MODE == ABSL_WAITER_MODE_STDCPP
0062 using Waiter = StdcppWaiter;
0063 #endif
0064
0065 }
0066 ABSL_NAMESPACE_END
0067 }
0068
0069 #endif