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

Unified Diff: nspr/pr/include/private/primpl.h

Issue 68173008: Update to NSPR 4.10.2. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/nss/
Patch Set: Update README.chromium Created 7 years, 1 month 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/include/prinit.h ('k') | nspr/pr/include/prthread.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: nspr/pr/include/private/primpl.h
===================================================================
--- nspr/pr/include/private/primpl.h (revision 233722)
+++ nspr/pr/include/private/primpl.h (working copy)
@@ -50,6 +50,10 @@
#include <sys/sem.h>
#endif
+#ifdef HAVE_SYSCALL
+#include <sys/syscall.h>
+#endif
+
/*************************************************************************
***** A Word about Model Dependent Function Naming Convention ***********
*************************************************************************/
@@ -186,6 +190,17 @@
NSPR_API(void) PT_FPrintStats(PRFileDesc *fd, const char *msg);
+/*
+ * On Linux and its derivatives POSIX priority scheduling works only for
+ * real-time threads. On those platforms we set thread's nice values
+ * instead which requires us to track kernel thread IDs for each POSIX
+ * thread we create.
+ */
+#if defined(LINUX) && defined(HAVE_SETPRIORITY) && \
+ ((defined(HAVE_SYSCALL) && defined(SYS_gettid)) || defined(HAVE_GETTID))
+#define _PR_NICE_PRIORITY_SCHEDULING
+#endif
+
#else /* defined(_PR_PTHREADS) */
NSPR_API(void) PT_FPrintStats(PRFileDesc *fd, const char *msg);
@@ -1540,6 +1555,9 @@
#if defined(_PR_PTHREADS)
pthread_t id; /* pthread identifier for the thread */
+#ifdef _PR_NICE_PRIORITY_SCHEDULING
+ pid_t tid; /* Linux-specific kernel thread ID */
+#endif
PRBool okToDelete; /* ok to delete the PRThread struct? */
PRCondVar *waiting; /* where the thread is waiting | NULL */
void *sp; /* recorded sp for garbage collection */
« no previous file with comments | « nspr/pr/include/prinit.h ('k') | nspr/pr/include/prthread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698