OLD | NEW |
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ | 1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
2 /* This Source Code Form is subject to the terms of the Mozilla Public | 2 /* This Source Code Form is subject to the terms of the Mozilla Public |
3 * License, v. 2.0. If a copy of the MPL was not distributed with this | 3 * License, v. 2.0. If a copy of the MPL was not distributed with this |
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
5 | 5 |
6 #ifndef primpl_h___ | 6 #ifndef primpl_h___ |
7 #define primpl_h___ | 7 #define primpl_h___ |
8 | 8 |
9 /* | 9 /* |
10 * HP-UX 10.10's pthread.h (DCE threads) includes dce/cma.h, which | 10 * HP-UX 10.10's pthread.h (DCE threads) includes dce/cma.h, which |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 | 43 |
44 #include "md/prosdep.h" | 44 #include "md/prosdep.h" |
45 #include "obsolete/probslet.h" | 45 #include "obsolete/probslet.h" |
46 | 46 |
47 #ifdef _PR_HAVE_POSIX_SEMAPHORES | 47 #ifdef _PR_HAVE_POSIX_SEMAPHORES |
48 #include <semaphore.h> | 48 #include <semaphore.h> |
49 #elif defined(_PR_HAVE_SYSV_SEMAPHORES) | 49 #elif defined(_PR_HAVE_SYSV_SEMAPHORES) |
50 #include <sys/sem.h> | 50 #include <sys/sem.h> |
51 #endif | 51 #endif |
52 | 52 |
| 53 #ifdef HAVE_SYSCALL |
| 54 #include <sys/syscall.h> |
| 55 #endif |
| 56 |
53 /************************************************************************* | 57 /************************************************************************* |
54 ***** A Word about Model Dependent Function Naming Convention *********** | 58 ***** A Word about Model Dependent Function Naming Convention *********** |
55 *************************************************************************/ | 59 *************************************************************************/ |
56 | 60 |
57 /* | 61 /* |
58 NSPR 2.0 must implement its function across a range of platforms | 62 NSPR 2.0 must implement its function across a range of platforms |
59 including: MAC, Windows/16, Windows/95, Windows/NT, and several | 63 including: MAC, Windows/16, Windows/95, Windows/NT, and several |
60 variants of Unix. Each implementation shares common code as well | 64 variants of Unix. Each implementation shares common code as well |
61 as having platform dependent portions. This standard describes how | 65 as having platform dependent portions. This standard describes how |
62 the model dependent portions are to be implemented. | 66 the model dependent portions are to be implemented. |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 PRUintn locks_created, locks_destroyed; | 183 PRUintn locks_created, locks_destroyed; |
180 PRUintn locks_acquired, locks_released; | 184 PRUintn locks_acquired, locks_released; |
181 PRUintn cvars_created, cvars_destroyed; | 185 PRUintn cvars_created, cvars_destroyed; |
182 PRUintn cvars_notified, delayed_cv_deletes; | 186 PRUintn cvars_notified, delayed_cv_deletes; |
183 } PTDebug; | 187 } PTDebug; |
184 | 188 |
185 #endif /* defined(DEBUG) */ | 189 #endif /* defined(DEBUG) */ |
186 | 190 |
187 NSPR_API(void) PT_FPrintStats(PRFileDesc *fd, const char *msg); | 191 NSPR_API(void) PT_FPrintStats(PRFileDesc *fd, const char *msg); |
188 | 192 |
| 193 /* |
| 194 * On Linux and its derivatives POSIX priority scheduling works only for |
| 195 * real-time threads. On those platforms we set thread's nice values |
| 196 * instead which requires us to track kernel thread IDs for each POSIX |
| 197 * thread we create. |
| 198 */ |
| 199 #if defined(LINUX) && defined(HAVE_SETPRIORITY) && \ |
| 200 ((defined(HAVE_SYSCALL) && defined(SYS_gettid)) || defined(HAVE_GETTID)) |
| 201 #define _PR_NICE_PRIORITY_SCHEDULING |
| 202 #endif |
| 203 |
189 #else /* defined(_PR_PTHREADS) */ | 204 #else /* defined(_PR_PTHREADS) */ |
190 | 205 |
191 NSPR_API(void) PT_FPrintStats(PRFileDesc *fd, const char *msg); | 206 NSPR_API(void) PT_FPrintStats(PRFileDesc *fd, const char *msg); |
192 | 207 |
193 /* | 208 /* |
194 ** This section is contains those parts needed to implement NSPR on | 209 ** This section is contains those parts needed to implement NSPR on |
195 ** platforms in general. One would assume that the pthreads implementation | 210 ** platforms in general. One would assume that the pthreads implementation |
196 ** included lots of the same types, at least conceptually. | 211 ** included lots of the same types, at least conceptually. |
197 */ | 212 */ |
198 | 213 |
(...skipping 1334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1533 void **privateData; /* private data vector or NULL */ | 1548 void **privateData; /* private data vector or NULL */ |
1534 PRErrorCode errorCode; /* current NSPR error code | zero */ | 1549 PRErrorCode errorCode; /* current NSPR error code | zero */ |
1535 PRInt32 osErrorCode; /* mapping of errorCode | zero */ | 1550 PRInt32 osErrorCode; /* mapping of errorCode | zero */ |
1536 PRIntn errorStringLength; /* textLength from last call to PR_SetErrorT
ext() */ | 1551 PRIntn errorStringLength; /* textLength from last call to PR_SetErrorT
ext() */ |
1537 PRInt32 errorStringSize; /* malloc()'d size of buffer | zero */ | 1552 PRInt32 errorStringSize; /* malloc()'d size of buffer | zero */ |
1538 char *errorString; /* current error string | NULL */ | 1553 char *errorString; /* current error string | NULL */ |
1539 char *name; /* thread's name */ | 1554 char *name; /* thread's name */ |
1540 | 1555 |
1541 #if defined(_PR_PTHREADS) | 1556 #if defined(_PR_PTHREADS) |
1542 pthread_t id; /* pthread identifier for the thread */ | 1557 pthread_t id; /* pthread identifier for the thread */ |
| 1558 #ifdef _PR_NICE_PRIORITY_SCHEDULING |
| 1559 pid_t tid; /* Linux-specific kernel thread ID */ |
| 1560 #endif |
1543 PRBool okToDelete; /* ok to delete the PRThread struct? */ | 1561 PRBool okToDelete; /* ok to delete the PRThread struct? */ |
1544 PRCondVar *waiting; /* where the thread is waiting | NULL */ | 1562 PRCondVar *waiting; /* where the thread is waiting | NULL */ |
1545 void *sp; /* recorded sp for garbage collection */ | 1563 void *sp; /* recorded sp for garbage collection */ |
1546 PRThread *next, *prev; /* simple linked list of all threads */ | 1564 PRThread *next, *prev; /* simple linked list of all threads */ |
1547 PRUint32 suspend; /* used to store suspend and resume flags */ | 1565 PRUint32 suspend; /* used to store suspend and resume flags */ |
1548 #ifdef PT_NO_SIGTIMEDWAIT | 1566 #ifdef PT_NO_SIGTIMEDWAIT |
1549 pthread_mutex_t suspendResumeMutex; | 1567 pthread_mutex_t suspendResumeMutex; |
1550 pthread_cond_t suspendResumeCV; | 1568 pthread_cond_t suspendResumeCV; |
1551 #endif | 1569 #endif |
1552 PRUint32 interrupt_blocked; /* interrupt blocked */ | 1570 PRUint32 interrupt_blocked; /* interrupt blocked */ |
(...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2090 | 2108 |
2091 extern ConnectListNode connectList[64]; | 2109 extern ConnectListNode connectList[64]; |
2092 | 2110 |
2093 extern PRUint32 connectCount; | 2111 extern PRUint32 connectCount; |
2094 | 2112 |
2095 #endif /* XP_BEOS */ | 2113 #endif /* XP_BEOS */ |
2096 | 2114 |
2097 PR_END_EXTERN_C | 2115 PR_END_EXTERN_C |
2098 | 2116 |
2099 #endif /* primpl_h___ */ | 2117 #endif /* primpl_h___ */ |
OLD | NEW |