VirtualBox

Changeset 6946 in vbox


Ignore:
Timestamp:
Feb 14, 2008 12:59:57 PM (17 years ago)
Author:
vboxsync
Message:

Aligned the TLS destructor bits with posix.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/thread.h

    r6937 r6946  
    379379 * @returns NIL_RTTLS on failure.
    380380 */
    381 RTR3DECL(int) RTTlsAlloc(void);
     381RTR3DECL(RTTLS) RTTlsAlloc(void);
    382382
    383383/**
     
    436436 *
    437437 * @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 */
     439typedef DECLCALLBACK(void) FNRTTLSDTOR(void *pvValue);
    442440/** Pointer to a FNRTTLSDTOR. */
    443441typedef FNRTTLSDTOR *PFNRTTLSDTOR;
     
    460458 *                          registered destructor.
    461459 *
    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 */
     461RTR3DECL(int) RTTlsSetDestructor(RTTLS iTls, PFNRTTLSDTOR pfnDestructor);
    473462
    474463/**
     
    482471 * @param   iTls            The index of the TLS entry.
    483472 * @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 */
     474PFNRTTLSDTOR RTTlsGetDestructor(RTTLS iTls, PFNRTTLSDTOR *ppfnDestructor);
    487475
    488476/** @} */
  • trunk/src/VBox/Runtime/r3/os2/thread-os2.cpp

    r6944 r6946  
    279279
    280280
    281 RTR3DECL(int) RTTlsSetDestructor(RTTLS iTls, PFNRTTLSDTOR pfnDestructor, uint32_t fFlags)
     281RTR3DECL(int) RTTlsSetDestructor(RTTLS iTls, PFNRTTLSDTOR pfnDestructor)
    282282{
    283283    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
     290PFNRTTLSDTOR RTTlsGetDestructor(RTTLS iTls, PFNRTTLSDTOR *ppfnDestructor)
     291{
     292    unsigned fFlags;
    295293    errno = 0;
    296     *ppfnDestructor = __libc_TLSGetDestructor(iTls, pFlags);
     294    *ppfnDestructor = (PFNRTTLSDTOR)__libc_TLSGetDestructor(iTls, &fFlags);
    297295    if (!*ppfnDestructor && errno)
    298296        return RTErrConvertFromErrno(errno);
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette