Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1674)

Unified Diff: nspr/pr/src/pthreads/ptthread.c

Issue 1843333003: Update NSPR to 4.12 and NSS to 3.23 on iOS (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/nss.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « nspr/pr/src/pthreads/ptio.c ('k') | nss.gyp » ('j') | nss/lib/util/secoid.c » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: nspr/pr/src/pthreads/ptthread.c
diff --git a/nspr/pr/src/pthreads/ptthread.c b/nspr/pr/src/pthreads/ptthread.c
index de90e4d39fdf4485f42240665db5ee913d162f05..9e12606ea3f4227943318fede21dc7799851e880 100644
--- a/nspr/pr/src/pthreads/ptthread.c
+++ b/nspr/pr/src/pthreads/ptthread.c
@@ -21,6 +21,10 @@
#include <signal.h>
#include <dlfcn.h>
+#if defined(OPENBSD) || defined(FREEBSD) || defined(DRAGONFLY)
+#include <pthread_np.h>
+#endif
+
#ifdef SYMBIAN
/* In Open C sched_get_priority_min/max do not work properly, so we undefine
* _POSIX_THREAD_PRIORITY_SCHEDULING here.
@@ -1733,7 +1737,7 @@ PR_IMPLEMENT(PRStatus) PR_SetCurrentThreadName(const char *name)
{
PRThread *thread;
size_t nameLen;
- int result;
+ int result = 0;
if (!name) {
PR_SetError(PR_INVALID_ARGUMENT_ERROR, 0);
@@ -1751,8 +1755,10 @@ PR_IMPLEMENT(PRStatus) PR_SetCurrentThreadName(const char *name)
return PR_FAILURE;
memcpy(thread->name, name, nameLen + 1);
-#if defined(OPENBSD) || defined(FREEBSD)
- result = pthread_set_name_np(thread->id, name);
+#if defined(OPENBSD) || defined(FREEBSD) || defined(DRAGONFLY)
+ pthread_set_name_np(thread->id, name);
+#elif defined(NETBSD)
+ result = pthread_setname_np(thread->id, "%s", (void *)name);
#else /* not BSD */
/*
* On OSX, pthread_setname_np is only available in 10.6 or later, so test
« no previous file with comments | « nspr/pr/src/pthreads/ptio.c ('k') | nss.gyp » ('j') | nss/lib/util/secoid.c » ('J')

Powered by Google App Engine
This is Rietveld 408576698