VirtualBox

Changeset 88810 in vbox for trunk/src/VBox/Runtime/common


Ignore:
Timestamp:
May 1, 2021 1:05:17 AM (4 years ago)
Author:
vboxsync
Message:

IPRT/RTReqPool: Added RTREQPOOLCFGVAR_THREAD_FLAGS so we can supply RTTHREADFLAGS_COM_MTA or similar to RTThreadCreate for the pool. bugref:9890

File:
1 edited

Legend:

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

    r82968 r88810  
    116116    /** The worker thread type. */
    117117    RTTHREADTYPE            enmThreadType;
     118    /** The work thread flags (RTTHREADFLAGS). */
     119    uint32_t                fThreadFlags;
    118120    /** The maximum number of worker threads. */
    119121    uint32_t                cMaxThreads;
     
    463465
    464466    int rc = RTThreadCreateF(&pThread->hThread, rtReqPoolThreadProc, pThread, 0 /*default stack size*/,
    465                              pPool->enmThreadType, 0 /*fFlags*/, "%s%02u", pPool->szName, pPool->cThreadsCreated);
     467                             pPool->enmThreadType, pPool->fThreadFlags, "%s%02u", pPool->szName, pPool->cThreadsCreated);
    466468    if (RT_SUCCESS(rc))
    467469        pPool->uLastThreadCreateNanoTs = pThread->uBirthNanoTs;
     
    658660        return VERR_NO_MEMORY;
    659661
    660     pPool->u32Magic         = RTREQPOOL_MAGIC;
     662    pPool->u32Magic             = RTREQPOOL_MAGIC;
    661663    RTStrCopy(pPool->szName, sizeof(pPool->szName), pszName);
    662664
    663665    pPool->enmThreadType        = RTTHREADTYPE_DEFAULT;
     666    pPool->fThreadFlags         = 0;
    664667    pPool->cMaxThreads          = cMaxThreads;
    665668    pPool->cMinThreads          = cMinThreads;
     
    731734            break;
    732735
     736        case RTREQPOOLCFGVAR_THREAD_FLAGS:
     737            AssertMsgBreakStmt(!(uValue & ~(uint64_t)RTTHREADFLAGS_MASK) && !(uValue & RTTHREADFLAGS_WAITABLE),
     738                               ("%#llx\n",  uValue), rc = VERR_INVALID_FLAGS);
     739
     740            pPool->fThreadFlags = (uint32_t)uValue;
     741            break;
     742
    733743        case RTREQPOOLCFGVAR_MIN_THREADS:
    734744            AssertMsgBreakStmt(uValue <= RTREQPOOL_MAX_THREADS,  ("%llu\n",  uValue), rc = VERR_OUT_OF_RANGE);
     
    881891            break;
    882892
     893        case RTREQPOOLCFGVAR_THREAD_FLAGS:
     894            u64 = pPool->fThreadFlags;
     895            break;
     896
    883897        case RTREQPOOLCFGVAR_MIN_THREADS:
    884898            u64 = pPool->cMinThreads;
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