Changeset 6961 in vbox
- Timestamp:
- Feb 14, 2008 5:39:02 PM (17 years ago)
- svn:sync-xref-src-repo-rev:
- 28130
- Location:
- trunk/src/VBox/Runtime
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/misc/thread.cpp
r5999 r6961 547 547 { 548 548 Assert(pThread->cRefs >= 1); 549 550 #ifdef IPRT_WITH_GENERIC_TLS 551 /* 552 * Destroy TLS entries. 553 */ 554 rtThreadTlsDestruction(pThread); 555 #endif /* IPRT_WITH_GENERIC_TLS */ 549 556 550 557 /* … … 1319 1326 #endif /* IN_RING3 */ 1320 1327 1328 1329 #ifdef IPRT_WITH_GENERIC_TLS 1330 1331 /** 1332 * Thread enumerator - clears a TLS entry. 1333 * 1334 * @returns 0. 1335 * @param pNode The thread node. 1336 * @param pvUser The TLS index. 1337 */ 1338 static DECLCALLBACK(int) rtThreadClearTlsEntryCallback(PAVLPVNODECORE pNode, void *pvUser) 1339 { 1340 PRTTHREADINT pThread = (PRTTHREADINT)pNode; 1341 RTTLS iTls = (RTTLS)(uintptr_t)pvUser; 1342 ASMAtomicWritePtr(&pThread->apvTlsEntries[iTls], NULL); 1343 return 0; 1344 } 1345 1346 1347 /** 1348 * Helper for the generic TLS implementation that clears a given TLS 1349 * entry on all threads. 1350 * 1351 * @param iTls The TLS entry. (valid) 1352 */ 1353 void rtThreadClearTlsEntry(RTTLS iTls) 1354 { 1355 RT_THREAD_LOCK_TMP(Tmp); 1356 RT_THREAD_LOCK_RD(Tmp); 1357 RTAvlPVDoWithAll(&g_ThreadTree, true /* fFromLeft*/, rtThreadClearTlsEntryCallback, (void *)(uintptr_t)iTls); 1358 RT_THREAD_UNLOCK_RD(Tmp); 1359 } 1360 1361 #endif /* IPRT_WITH_GENERIC_TLS */ 1362 -
trunk/src/VBox/Runtime/include/internal/thread.h
r5999 r6961 79 79 /** Max thread name length. */ 80 80 #define RTTHREAD_NAME_LEN 16 81 #ifdef IPRT_WITH_GENERIC_TLS 82 /** The number of TLS entries for the generic implementation. */ 83 # define RTTHREAD_TLS_ENTRIES 64 84 #endif 81 85 82 86 /** … … 133 137 RTUINTPTR volatile uBlockId; 134 138 #endif /* IN_RING3 */ 139 #ifdef IPRT_WITH_GENERIC_TLS 140 /** The TLS entries for this thread. */ 141 void *apvTlsEntries[RTTHREAD_TLS_ENTRIES]; 142 #endif 135 143 /** Thread name. */ 136 144 char szName[RTTHREAD_NAME_LEN]; … … 222 230 int rtThreadDoSetProcPriority(RTPROCPRIORITY enmPriority); 223 231 #endif /* !IN_RING0 */ 232 #ifdef IPRT_WITH_GENERIC_TLS 233 void rtThreadClearTlsEntry(RTTLS iTls); 234 void rtThreadTlsDestruction(PRTTHREADINT pThread); /* in tls-generic.cpp */ 235 #endif 224 236 225 237 __END_DECLS
Note:
See TracChangeset
for help on using the changeset viewer.