Changeset 1402
- Timestamp:
- Apr 29, 2004, 6:12:23 AM (21 years ago)
- Location:
- trunk/src/emx
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/src/emx/include/InnoTekLIBC/thread.h ¶
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r1401 r1402 344 344 * this function. The result from doing that is undefined. 345 345 */ 346 int __libc_TLSDestructor(int iIndex, void (*pfnDestructor)(void *pvValue, unsigned fFlags), unsigned fFlags); 346 int __libc_TLSDestructor(int iIndex, void (*pfnDestructor)(void *pvValue, int iTLSIndex, unsigned fFlags), unsigned fFlags); 347 348 349 /** 350 * Get pointer to the destructor function registered for the given TLS entry. 351 * 352 * @returns NULL if invalid entry, errno set. 353 * @returns NULL if no entry registered. 354 * @returns Pointer to destructor if registered. 355 * 356 * @param iTLSIndex Value returned by __libc_TLSAlloc(). 357 * @param pfFlags Where to store the flags supplied to __libc_TLSDestructor(). 358 * NULL is ok. 359 */ 360 void (*__libc_TLSGetDestructor(int iTLSIndex, unsigned *pfFlags))(void *, int, unsigned); 347 361 348 362 /** @} */ -
Property cvs2svn:cvs-rev
changed from
-
TabularUnified trunk/src/emx/src/lib/libc.def ¶
-
Property cvs2svn:cvs-rev
changed from
1.55
to1.56
r1401 r1402 1097 1097 "___libc_TLSDestructor" @1119 1098 1098 "___libc_ThreadRegisterTermCallback" @1120 1099 "___libc_TLSGetDestructor" @1121 -
Property cvs2svn:cvs-rev
changed from
-
TabularUnified trunk/src/emx/src/lib/process/tls.c ¶
-
Property cvs2svn:cvs-rev
changed from
1.4
to1.5
r1401 r1402 69 69 70 70 /** TLS Per Thread Destructors. */ 71 static void (*gapfnDestructors[__LIBC_TLS_MAX])(void *, unsigned);71 static void (*gapfnDestructors[__LIBC_TLS_MAX])(void *, int, unsigned); 72 72 73 73 /** Thread Termination Registration Record. */ … … 157 157 */ 158 158 gapfnDestructors[iIndex] = NULL; 159 /* @todo do serialized NULLing of all threads! */ 159 160 __atomic_clear_bit(&gauBitmap[0], iIndex); 160 161 … … 216 217 217 218 218 int __libc_TLSDestructor(int iIndex, void (*pfnDestructor)(void *pvValue, unsigned fFlags), unsigned fFlags)219 int __libc_TLSDestructor(int iIndex, void (*pfnDestructor)(void *pvValue, int iTLSIndex, unsigned fFlags), unsigned fFlags) 219 220 { 220 221 LIBCLOG_ENTER("iIndex=%d pfnDestructor=%p\n", iIndex, pfnDestructor); … … 302 303 while (k < kEnd) 303 304 { 304 void (*pfnDestructor)(void *, unsigned); 305 void (*pfnDestructor)(void *, int, unsigned); 306 void *pvValue; 305 307 if ( __atomic_test_bit(&gauBitmap[0], k) 306 308 && k < __LIBC_TLS_MAX 307 && pThrd->apvTLS[k]309 && (pvValue = pThrd->apvTLS[k]) != NULL 308 310 && (pfnDestructor = gapfnDestructors[k]) != NULL) 309 311 { 310 312 LIBCLOG_MSG("tls %d: calling %p with %p\n", k, (void *)pfnDestructor, pThrd->apvTLS[k]); 311 pfnDestructor(pThrd->apvTLS[k], fFlags); 313 pThrd->apvTLS[k] = NULL; 314 pfnDestructor(pvValue, k, fFlags); 312 315 } 313 316 … … 321 324 LIBCLOG_RETURN_VOID(); 322 325 } 326 327 328 void (*__libc_TLSGetDestructor(int iTLSIndex, unsigned *pfFlags))(void *, int, unsigned) 329 { 330 LIBCLOG_ENTER("iTLSIndex=%d, pfFlags=%p\n", iTLSIndex, pfFlags); 331 void (*pfnDestructor)(void *, int, unsigned); 332 333 /* 334 * Validate index 335 */ 336 if ( iTLSIndex < 0 337 || iTLSIndex >= __LIBC_TLS_MAX 338 || !__atomic_test_bit(&gauBitmap[0], iTLSIndex) 339 ) 340 { 341 LIBC_ASSERTM_FAILED("Bad index %d. (max=%d)\n", iTLSIndex, __LIBC_TLS_MAX); 342 errno = EINVAL; 343 LIBCLOG_RETURN_P(NULL); 344 } 345 346 pfnDestructor = gapfnDestructors[iTLSIndex]; 347 if (pfFlags) 348 *pfFlags = 0; 349 LIBCLOG_RETURN_P(pfnDestructor); 350 } -
Property cvs2svn:cvs-rev
changed from
Note:
See TracChangeset
for help on using the changeset viewer.