Changeset 1402 for trunk/src


Ignore:
Timestamp:
Apr 29, 2004, 6:12:23 AM (22 years ago)
Author:
bird
Message:

More TLS.

Location:
trunk/src/emx
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/emx/include/InnoTekLIBC/thread.h

    • Property cvs2svn:cvs-rev changed from 1.3 to 1.4
    r1401 r1402  
    344344 *          this function. The result from doing that is undefined.
    345345 */
    346 int     __libc_TLSDestructor(int iIndex, void (*pfnDestructor)(void *pvValue, unsigned fFlags), unsigned fFlags);
     346int     __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 */
     360void (*__libc_TLSGetDestructor(int iTLSIndex, unsigned *pfFlags))(void *, int, unsigned);
    347361
    348362/** @} */
  • trunk/src/emx/src/lib/libc.def

    • Property cvs2svn:cvs-rev changed from 1.55 to 1.56
    r1401 r1402  
    10971097    "___libc_TLSDestructor" @1119
    10981098    "___libc_ThreadRegisterTermCallback" @1120
     1099
  • trunk/src/emx/src/lib/process/tls.c

    • Property cvs2svn:cvs-rev changed from 1.4 to 1.5
    r1401 r1402  
    6969
    7070/** TLS Per Thread Destructors. */
    71 static   void (*gapfnDestructors[__LIBC_TLS_MAX])(void *, unsigned);
     71static   void (*gapfnDestructors[__LIBC_TLS_MAX])(void *, unsigned);
    7272
    7373/** Thread Termination Registration Record. */
     
    157157     */
    158158    gapfnDestructors[iIndex] = NULL;
     159
    159160    __atomic_clear_bit(&gauBitmap[0], iIndex);
    160161
     
    216217
    217218
    218 int     __libc_TLSDestructor(int iIndex, void (*pfnDestructor)(void *pvValue, unsigned fFlags), unsigned fFlags)
     219int     __libc_TLSDestructor(int iIndex, void (*pfnDestructor)(void *pvValue, unsigned fFlags), unsigned fFlags)
    219220{
    220221    LIBCLOG_ENTER("iIndex=%d pfnDestructor=%p\n", iIndex, pfnDestructor);
     
    302303                    while (k < kEnd)
    303304                    {
    304                         void (*pfnDestructor)(void *, unsigned);
     305                        void (*pfnDestructor)(void *, int, unsigned);
     306                        void  *pvValue;
    305307                        if (    __atomic_test_bit(&gauBitmap[0], k)   
    306308                            &&  k < __LIBC_TLS_MAX
    307                             &&  pThrd->apvTLS[k]
     309                            && 
    308310                            &&  (pfnDestructor = gapfnDestructors[k]) != NULL)
    309311                        {
    310312                            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);
    312315                        }
    313316
     
    321324    LIBCLOG_RETURN_VOID();
    322325}
     326
     327
     328
     329
     330
     331
     332
     333
     334
     335
     336
     337
     338
     339
     340
     341
     342
     343
     344
     345
     346
     347
     348
     349
     350
Note: See TracChangeset for help on using the changeset viewer.