Commit fb3621f4 by Derek Mauro Committed by GitHub

Abseil LTS branch, Aug 2023, Patch 1 (#1534)

* Add StdcppWaiter to the end of the list of waiter implementations

Since ABSL_INTERNAL_HAVE_STDCPP_WAITER is defined on all systems
it is effectively a fallback. I left the condition there in case
we have to disable it on some platform in the future.

PiperOrigin-RevId: 555629066
Change-Id: I76ca78c7f36d1d02dc4950a44c66903a2aaf2a52

* Use native methods to implement absl::base_internal::GetPID() on
FreeBSD, NetBSD, and OpenBSD

https://man.freebsd.org/cgi/man.cgi?query=pthread_getthreadid_np
https://man.netbsd.org/_lwp_self.2
https://man.openbsd.org/getthrid.2

* Abseil LTS branch, Aug 2023, Patch 1
Bump ABSL_LTS_RELEASE_PATCH_LEVEL to 1
parent 29bf8085
...@@ -112,7 +112,7 @@ ...@@ -112,7 +112,7 @@
// LTS releases can be obtained from // LTS releases can be obtained from
// https://github.com/abseil/abseil-cpp/releases. // https://github.com/abseil/abseil-cpp/releases.
#define ABSL_LTS_RELEASE_VERSION 20230802 #define ABSL_LTS_RELEASE_VERSION 20230802
#define ABSL_LTS_RELEASE_PATCH_LEVEL 0 #define ABSL_LTS_RELEASE_PATCH_LEVEL 1
// Helper macro to convert a CPP variable to a string literal. // Helper macro to convert a CPP variable to a string literal.
#define ABSL_INTERNAL_DO_TOKEN_STR(x) #x #define ABSL_INTERNAL_DO_TOKEN_STR(x) #x
......
...@@ -34,6 +34,14 @@ ...@@ -34,6 +34,14 @@
#include <sys/sysctl.h> #include <sys/sysctl.h>
#endif #endif
#ifdef __FreeBSD__
#include <pthread_np.h>
#endif
#ifdef __NetBSD__
#include <lwp.h>
#endif
#if defined(__myriad2__) #if defined(__myriad2__)
#include <rtems.h> #include <rtems.h>
#endif #endif
...@@ -432,6 +440,18 @@ pid_t GetTID() { ...@@ -432,6 +440,18 @@ pid_t GetTID() {
return static_cast<pid_t>(tid); return static_cast<pid_t>(tid);
} }
#elif defined(__FreeBSD__)
pid_t GetTID() { return static_cast<pid_t>(pthread_getthreadid_np()); }
#elif defined(__OpenBSD__)
pid_t GetTID() { return getthrid(); }
#elif defined(__NetBSD__)
pid_t GetTID() { return static_cast<pid_t>(_lwp_self()); }
#elif defined(__native_client__) #elif defined(__native_client__)
pid_t GetTID() { pid_t GetTID() {
......
...@@ -40,6 +40,8 @@ ...@@ -40,6 +40,8 @@
#define ABSL_WAITER_MODE ABSL_WAITER_MODE_SEM #define ABSL_WAITER_MODE ABSL_WAITER_MODE_SEM
#elif defined(ABSL_INTERNAL_HAVE_PTHREAD_WAITER) #elif defined(ABSL_INTERNAL_HAVE_PTHREAD_WAITER)
#define ABSL_WAITER_MODE ABSL_WAITER_MODE_CONDVAR #define ABSL_WAITER_MODE ABSL_WAITER_MODE_CONDVAR
#elif defined(ABSL_INTERNAL_HAVE_STDCPP_WAITER)
#define ABSL_WAITER_MODE ABSL_WAITER_MODE_STDCPP
#else #else
#error ABSL_WAITER_MODE is undefined #error ABSL_WAITER_MODE is undefined
#endif #endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment