diff options
author | jbeich <jbeich@FreeBSD.org> | 2019-07-10 09:16:24 +0800 |
---|---|---|
committer | jbeich <jbeich@FreeBSD.org> | 2019-07-10 09:16:24 +0800 |
commit | 22b2db9445b2da3522cc5d06d3cea2d1ace325f0 (patch) | |
tree | da359d15146e7d177ee74a98e5f4cf92eb39a58c /audio | |
parent | 73563d6a275ca3939accc52f74cb0594e4f1917a (diff) | |
download | freebsd-ports-gnome-22b2db9445b2da3522cc5d06d3cea2d1ace325f0.tar.gz freebsd-ports-gnome-22b2db9445b2da3522cc5d06d3cea2d1ace325f0.tar.zst freebsd-ports-gnome-22b2db9445b2da3522cc5d06d3cea2d1ace325f0.zip |
Add more gettid() aliases to my ports
https://man.openbsd.org/getthrid.2
https://illumos.org/man/3C/thr_self
Diffstat (limited to 'audio')
-rw-r--r-- | audio/webrtc-audio-processing/files/patch-webrtc_base_platform__thread.cc | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/audio/webrtc-audio-processing/files/patch-webrtc_base_platform__thread.cc b/audio/webrtc-audio-processing/files/patch-webrtc_base_platform__thread.cc index 966592b0e42a..23840052102e 100644 --- a/audio/webrtc-audio-processing/files/patch-webrtc_base_platform__thread.cc +++ b/audio/webrtc-audio-processing/files/patch-webrtc_base_platform__thread.cc @@ -16,7 +16,7 @@ namespace rtc { PlatformThreadId CurrentThreadId() { -@@ -32,9 +38,15 @@ PlatformThreadId CurrentThreadId() { +@@ -32,6 +38,12 @@ PlatformThreadId CurrentThreadId() { ret = syscall(__NR_gettid); #elif defined(WEBRTC_ANDROID) ret = gettid(); @@ -24,16 +24,12 @@ + ret = pthread_getthreadid_np(); +#elif defined(__NetBSD__) // WEBRTC_BSD + ret = _lwp_self(); ++#elif defined(__OpenBSD__) // WEBRTC_BSD ++ ret = getthrid(); #else // Default implementation for nacl and solaris. -- ret = reinterpret_cast<pid_t>(pthread_self()); -+ // WEBRTC_BSD: pthread_t is a pointer, so cannot be casted to pid_t -+ // (aka int32_t) on 64-bit archs. Required on OpenBSD. -+ ret = reinterpret_cast<uintptr_t>(pthread_self()); - #endif - #endif // defined(WEBRTC_POSIX) - RTC_DCHECK(ret); -@@ -76,6 +90,10 @@ void SetCurrentThreadName(const char* name) { + ret = reinterpret_cast<pid_t>(pthread_self()); +@@ -76,6 +88,10 @@ void SetCurrentThreadName(const char* name) { prctl(PR_SET_NAME, reinterpret_cast<unsigned long>(name)); #elif defined(WEBRTC_MAC) || defined(WEBRTC_IOS) pthread_setname_np(name); |