blob: 75a37d2e313097a914c7fb9d60864af953977cbc (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
# HG changeset patch
# User Jory A. Pratt <anarchy@gentoo.org>
# Parent c8a96cc4fd48dfad892f7b92f8a472ea71e683e9
set pthread name for non glibc systems
diff --git a/js/src/threading/posix/PosixThread.cpp b/js/src/threading/posix/PosixThread.cpp
--- a/js/src/threading/posix/PosixThread.cpp
+++ b/js/src/threading/posix/PosixThread.cpp
@@ -94,18 +94,20 @@ void ThisThread::SetName(const char* nam
int rv;
#ifdef XP_DARWIN
rv = pthread_setname_np(name);
#elif defined(__DragonFly__) || defined(__FreeBSD__) || defined(__OpenBSD__)
pthread_set_name_np(pthread_self(), name);
rv = 0;
#elif defined(__NetBSD__)
rv = pthread_setname_np(pthread_self(), "%s", (void*)name);
+#elif defined(__GLIBC__)
+ rv = pthread_setname_np(pthread_self(), name);
#else
- rv = pthread_setname_np(pthread_self(), name);
+ rv = 0;
#endif
MOZ_RELEASE_ASSERT(!rv || mozilla::recordreplay::IsRecordingOrReplaying());
}
void ThisThread::GetName(char* nameBuffer, size_t len) {
MOZ_RELEASE_ASSERT(len >= 16);
int rv = -1;
|