Skip to content

Commit fb3621f

Browse files
authored
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
1 parent 29bf808 commit fb3621f

File tree

3 files changed

+23
-1
lines changed

3 files changed

+23
-1
lines changed

absl/base/config.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@
112112
// LTS releases can be obtained from
113113
// https://github.com/abseil/abseil-cpp/releases.
114114
#define ABSL_LTS_RELEASE_VERSION 20230802
115-
#define ABSL_LTS_RELEASE_PATCH_LEVEL 0
115+
#define ABSL_LTS_RELEASE_PATCH_LEVEL 1
116116

117117
// Helper macro to convert a CPP variable to a string literal.
118118
#define ABSL_INTERNAL_DO_TOKEN_STR(x) #x

absl/base/internal/sysinfo.cc

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,14 @@
3434
#include <sys/sysctl.h>
3535
#endif
3636

37+
#ifdef __FreeBSD__
38+
#include <pthread_np.h>
39+
#endif
40+
41+
#ifdef __NetBSD__
42+
#include <lwp.h>
43+
#endif
44+
3745
#if defined(__myriad2__)
3846
#include <rtems.h>
3947
#endif
@@ -432,6 +440,18 @@ pid_t GetTID() {
432440
return static_cast<pid_t>(tid);
433441
}
434442

443+
#elif defined(__FreeBSD__)
444+
445+
pid_t GetTID() { return static_cast<pid_t>(pthread_getthreadid_np()); }
446+
447+
#elif defined(__OpenBSD__)
448+
449+
pid_t GetTID() { return getthrid(); }
450+
451+
#elif defined(__NetBSD__)
452+
453+
pid_t GetTID() { return static_cast<pid_t>(_lwp_self()); }
454+
435455
#elif defined(__native_client__)
436456

437457
pid_t GetTID() {

absl/synchronization/internal/waiter.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@
4040
#define ABSL_WAITER_MODE ABSL_WAITER_MODE_SEM
4141
#elif defined(ABSL_INTERNAL_HAVE_PTHREAD_WAITER)
4242
#define ABSL_WAITER_MODE ABSL_WAITER_MODE_CONDVAR
43+
#elif defined(ABSL_INTERNAL_HAVE_STDCPP_WAITER)
44+
#define ABSL_WAITER_MODE ABSL_WAITER_MODE_STDCPP
4345
#else
4446
#error ABSL_WAITER_MODE is undefined
4547
#endif

0 commit comments

Comments
 (0)