Changeset 6946 in vbox
- Timestamp:
- Feb 14, 2008 12:59:57 PM (17 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/thread.h
r6937 r6946 379 379 * @returns NIL_RTTLS on failure. 380 380 */ 381 RTR3DECL( int) RTTlsAlloc(void);381 RTR3DECL(RTTLS) RTTlsAlloc(void); 382 382 383 383 /** … … 436 436 * 437 437 * @param pvValue The current value. 438 * @param iTls The index of TLS entry. 439 * @param fFlags Reserved for the future. 440 */ 441 typedef DECLCALLBACK(void) FNRTTLSDTOR(void *pvValue, RTTLS iTls, uint32_t fFlags); 438 */ 439 typedef DECLCALLBACK(void) FNRTTLSDTOR(void *pvValue); 442 440 /** Pointer to a FNRTTLSDTOR. */ 443 441 typedef FNRTTLSDTOR *PFNRTTLSDTOR; … … 460 458 * registered destructor. 461 459 * 462 * It's pvValue argument is the non-zero value in the 463 * TLS entry for the thread it's called on. 464 * 465 * It's fFlags argument is reserved for future use, it will 466 * always be zero when the fFlags parameter to this API is zero. 467 * 468 * @param fFlags Flags reserved for future use. At the moment 469 * only ZERO is allowed. 470 * 471 */ 472 RTR3DECL(int) RTTlsSetDestructor(RTTLS iTls, PFNRTTLSDTOR pfnDestructor, uint32_t fFlags); 460 */ 461 RTR3DECL(int) RTTlsSetDestructor(RTTLS iTls, PFNRTTLSDTOR pfnDestructor); 473 462 474 463 /** … … 482 471 * @param iTls The index of the TLS entry. 483 472 * @param ppfnDestructor Where to store the destructor address. 484 * @param pfFlags Where to store the flags supplied to RTTlsSetDestructor(). NULL is fine. 485 */ 486 PFNRTTLSDTOR RTTlsGetDestructor(RTTLS iTls, PFNRTTLSDTOR *ppfnDestructor, uint32_t *pfFlags); 473 */ 474 PFNRTTLSDTOR RTTlsGetDestructor(RTTLS iTls, PFNRTTLSDTOR *ppfnDestructor); 487 475 488 476 /** @} */ -
trunk/src/VBox/Runtime/r3/os2/thread-os2.cpp
r6944 r6946 279 279 280 280 281 RTR3DECL(int) RTTlsSetDestructor(RTTLS iTls, PFNRTTLSDTOR pfnDestructor , uint32_t fFlags)281 RTR3DECL(int) RTTlsSetDestructor(RTTLS iTls, PFNRTTLSDTOR pfnDestructor) 282 282 { 283 283 AssertReturn(!fFlags, VERR_INVALID_PARAMETER) 284 if (__libc_TLSDestructor(iTls, pfnDestructor, fFlags) == -1) 285 return VINF_SUCCESS; 286 return RTErrConvertFromErrno(errno); 287 } 288 289 290 PFNRTTLSDTOR RTTlsGetDestructor(RTTLS iTls, PFNRTTLSDTOR *ppfnDestructor, uint32_t *pfFlags) 291 { 292 uint32_t fFlags; 293 if (!pfFlags) 294 pfFlags = &fFlags; 284 if (__libc_TLSDestructor(iTls, (void (*)(void *, int, unsigned))pfnDestructor, fFlags) == -1) 285 return VINF_SUCCESS; 286 return RTErrConvertFromErrno(errno); 287 } 288 289 290 PFNRTTLSDTOR RTTlsGetDestructor(RTTLS iTls, PFNRTTLSDTOR *ppfnDestructor) 291 { 292 unsigned fFlags; 295 293 errno = 0; 296 *ppfnDestructor = __libc_TLSGetDestructor(iTls, pFlags);294 *ppfnDestructor = (PFNRTTLSDTOR)__libc_TLSGetDestructor(iTls, &fFlags); 297 295 if (!*ppfnDestructor && errno) 298 296 return RTErrConvertFromErrno(errno);
Note:
See TracChangeset
for help on using the changeset viewer.