VirtualBox

Ignore:
Timestamp:
Apr 23, 2013 11:28:41 AM (12 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
85204
Message:

Runtime/aio: Add flags parameter to RTFileAioCtxCreate

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r3/solaris/fileaio-solaris.cpp

    r44528 r45678  
    5656    /** Current number of requests active on this context. */
    5757    volatile int32_t  cRequests;
     58    /** Flags given during creation. */
     59    uint32_t          fFlags;
    5860    /** Magic value (RTFILEAIOCTX_MAGIC). */
    5961    uint32_t          u32Magic;
     
    271273}
    272274
    273 RTDECL(int) RTFileAioCtxCreate(PRTFILEAIOCTX phAioCtx, uint32_t cAioReqsMax)
     275RTDECL(int) RTFileAioCtxCreate(PRTFILEAIOCTX phAioCtx, uint32_t cAioReqsMax,
     276                               uint32_t fFlags)
    274277{
    275278    int rc = VINF_SUCCESS;
    276279    PRTFILEAIOCTXINTERNAL pCtxInt;
    277280    AssertPtrReturn(phAioCtx, VERR_INVALID_POINTER);
     281    AssertReturn(!(fFlags & ~RTFILEAIOCTX_FLAGS_VALID_MASK), VERR_INVALID_PARAMETER);
    278282
    279283    pCtxInt = (PRTFILEAIOCTXINTERNAL)RTMemAllocZ(sizeof(RTFILEAIOCTXINTERNAL));
     
    285289    if (RT_LIKELY(pCtxInt->iPort > 0))
    286290    {
    287         pCtxInt->u32Magic     = RTFILEAIOCTX_MAGIC;
     291        pCtxInt->fFlags   = fFlags;
     292        pCtxInt->u32Magic = RTFILEAIOCTX_MAGIC;
    288293        *phAioCtx = (RTFILEAIOCTX)pCtxInt;
    289294    }
     
    449454    AssertReturn(cReqs >= cMinReqs, VERR_OUT_OF_RANGE);
    450455
    451     if (RT_UNLIKELY(ASMAtomicReadS32(&pCtxInt->cRequests) == 0))
     456    if (    RT_UNLIKELY(ASMAtomicReadS32(&pCtxInt->cRequests) == 0)
     457        && !(pCtxInt->fFlags & RTFILEAIOCTX_FLAGS_WAIT_WITHOUT_PENDING_REQUESTS))
    452458        return VERR_FILE_AIO_NO_REQUEST;
    453459
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