VirtualBox

Ignore:
Timestamp:
Aug 5, 2022 10:48:48 AM (3 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
152851
Message:

IPRT/nocrt: Added no-CRT per-thread data like errno and strtok state. Implemented strtol and errno accessor. bugref:10261

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/misc/thread.cpp

    r95200 r96052  
    394394#ifdef RT_WITH_ICONV_CACHE
    395395        rtStrIconvCacheInit(pThread);
     396#endif
     397#if defined(IPRT_NO_CRT) && defined(IN_RING3)
     398        pThread->NoCrt.enmAllocType = RTNOCRTTHREADDATA::kAllocType_Embedded;
     399        RTListInit(&pThread->NoCrt.ListEntry);
    396400#endif
    397401        rc = RTSemEventMultiCreate(&pThread->EventUser);
     
    465469                    ASMAtomicIncU32(&g_cThreadInTree);
    466470                    ASMAtomicIncU32(&g_acRTThreadTypeStats[pThread->enmType]);
     471
     472#if defined(IPRT_NO_CRT) && defined(IN_RING3)
     473                    RTTLS const iTlsPerThread = g_iTlsRtNoCrtPerThread;
     474                    if (   iTlsPerThread != NIL_RTTLS
     475                        && RTTlsGet(iTlsPerThread) == NULL)
     476                        RTTlsSet(iTlsPerThread, &pThread->NoCrt);
     477#endif
    467478                }
    468479
     
    687698     */
    688699    rtThreadRemove(pThread);
     700
     701#if defined(IPRT_NO_CRT) && defined(IN_RING3)
     702    RTTLS const iTlsPerThread = g_iTlsRtNoCrtPerThread;
     703    if (   iTlsPerThread != NIL_RTTLS
     704        && RTTlsGet(iTlsPerThread) == &pThread->NoCrt)
     705        RTTlsSet(iTlsPerThread, &g_RtNoCrtPerThreadDummy);
     706#endif
     707
    689708    rtThreadRelease(pThread);
    690709}
Note: See TracChangeset for help on using the changeset viewer.

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