VirtualBox

Changeset 16200 in vbox for trunk/src/VBox/Runtime


Ignore:
Timestamp:
Jan 23, 2009 3:26:36 PM (16 years ago)
Author:
vboxsync
Message:

Solaris/vboxdrv: Use rwlock instead of mutex (#3021).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r0drv/solaris/semfastmutex-r0drv-solaris.c

    r8245 r16200  
    5555    uint32_t            u32Magic;
    5656    /** The Solaris mutex. */
    57     kmutex_t            Mtx;
     57    krwlock_t           Mtx;
    5858} RTSEMFASTMUTEXINTERNAL, *PRTSEMFASTMUTEXINTERNAL;
    5959
     
    6868    {
    6969        pFastInt->u32Magic = RTSEMFASTMUTEX_MAGIC;
    70         mutex_init (&pFastInt->Mtx, "IPRT Fast Mutex Semaphore", MUTEX_DRIVER, NULL);
     70        rw_init (&pFastInt->Mtx, "RWLOCK", RW_DRIVER, NULL);
    7171        *pMutexSem = pFastInt;
    7272        return VINF_SUCCESS;
     
    8787
    8888    ASMAtomicXchgU32(&pFastInt->u32Magic, RTSEMFASTMUTEX_MAGIC_DEAD);
    89     mutex_destroy(&pFastInt->Mtx);
     89    rw_destroy(&pFastInt->Mtx);
    9090    RTMemFree(pFastInt);
    9191
     
    102102                    VERR_INVALID_PARAMETER);
    103103
    104     mutex_enter(&pFastInt->Mtx);
     104    rw_enter(&pFastInt->Mtx, RW_WRITER);
    105105    return VINF_SUCCESS;
    106106}
     
    115115                    VERR_INVALID_PARAMETER);
    116116
    117     mutex_exit(&pFastInt->Mtx);
     117    rw_exit(&pFastInt->Mtx);
    118118    return VINF_SUCCESS;
    119119}
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