VirtualBox

Ignore:
Timestamp:
Apr 28, 2019 4:47:51 PM (6 years ago)
Author:
vboxsync
Message:

Config.kmk,Additions/common/crOpenGL,VBox/GuestHost/OpenGL,HostServices/SharedOpenGL: Remove CHROMIUM_THREADSAFE define and apply the current default

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/GuestHost/OpenGL/util/vboxhgcm.c

    r78263 r78341  
    169169    CRConnection         **conns;
    170170    CRBufferPool         *bufpool;
    171 #ifdef CHROMIUM_THREADSAFE
    172171    CRmutex              mutex;
    173172    CRmutex              recvmutex;
    174 #endif
    175173    CRNetReceiveFuncList *recv_list;
    176174    CRNetCloseFuncList   *close_list;
     
    637635    CRVBOXHGCMBUFFER *buf;
    638636
    639 #ifdef CHROMIUM_THREADSAFE
    640637    crLockMutex(&g_crvboxhgcm.mutex);
    641 #endif
    642 
    643638    buf = (CRVBOXHGCMBUFFER *) crBufferPoolPop(g_crvboxhgcm.bufpool, conn->buffer_size);
    644639
     
    661656    }
    662657
    663 #ifdef CHROMIUM_THREADSAFE
    664658    crUnlockMutex(&g_crvboxhgcm.mutex);
    665 #endif
    666 
    667659    return (void *)( buf + 1 );
    668660
     
    673665    void *pvBuff;
    674666    VBOXCRHGSMIPROFILE_FUNC_PROLOGUE();
    675 #ifdef CHROMIUM_THREADSAFE
    676667    crLockMutex(&g_crvboxhgcm.mutex);
    677 #endif
    678668    pvBuff = _crVBoxHGCMAlloc(conn);
    679 #ifdef CHROMIUM_THREADSAFE
    680669    crUnlockMutex(&g_crvboxhgcm.mutex);
    681 #endif
    682670    VBOXCRHGSMIPROFILE_FUNC_EPILOGUE();
    683671    return pvBuff;
     
    730718{
    731719    VBOXCRHGSMIPROFILE_FUNC_PROLOGUE();
    732 #ifdef CHROMIUM_THREADSAFE
     720
    733721    crLockMutex(&g_crvboxhgcm.mutex);
    734 #endif
    735722    _crVBoxHGCMWriteExact(conn, buf, len);
    736 #ifdef CHROMIUM_THREADSAFE
    737723    crUnlockMutex(&g_crvboxhgcm.mutex);
    738 #endif
    739724    VBOXCRHGSMIPROFILE_FUNC_EPILOGUE();
    740725}
     
    908893    VBOXCRHGSMIPROFILE_FUNC_PROLOGUE();
    909894
    910 #ifdef CHROMIUM_THREADSAFE
    911895    crLockMutex(&g_crvboxhgcm.mutex);
    912 #endif
    913 
    914896    if (!bufp) /* We're sending a user-allocated buffer. */
    915897    {
     
    923905            crVBoxHGCMWriteReadExact(conn, start, len, CR_VBOXHGCM_USERALLOCATED);
    924906#endif
    925 #ifdef CHROMIUM_THREADSAFE
    926907            crUnlockMutex(&g_crvboxhgcm.mutex);
    927 #endif
    928908            VBOXCRHGSMIPROFILE_FUNC_EPILOGUE();
    929909        return;
     
    951931
    952932    /* Reclaim this pointer for reuse */
    953 #ifdef CHROMIUM_THREADSAFE
    954933    crLockMutex(&g_crvboxhgcm.mutex);
    955 #endif
    956934    crBufferPoolPush(g_crvboxhgcm.bufpool, hgcm_buffer, hgcm_buffer->allocated);
    957 #ifdef CHROMIUM_THREADSAFE
    958935    crUnlockMutex(&g_crvboxhgcm.mutex);
    959 #endif
    960936
    961937    /* Since the buffer's now in the 'free' buffer pool, the caller can't
     
    965941    *bufp = NULL;
    966942
    967 #ifdef CHROMIUM_THREADSAFE
    968943    crUnlockMutex(&g_crvboxhgcm.mutex);
    969 #endif
    970 
    971944    VBOXCRHGSMIPROFILE_FUNC_EPILOGUE();
    972945}
     
    1006979{
    1007980    VBOXCRHGSMIPROFILE_FUNC_PROLOGUE();
    1008 #ifdef CHROMIUM_THREADSAFE
    1009981    crLockMutex(&g_crvboxhgcm.mutex);
    1010 #endif
    1011982    crVBoxHGCMReadExact(conn, buf, len);
    1012 #ifdef CHROMIUM_THREADSAFE
    1013983    crUnlockMutex(&g_crvboxhgcm.mutex);
    1014 #endif
    1015984    VBOXCRHGSMIPROFILE_FUNC_EPILOGUE();
    1016985}
     
    1028997    {
    1029998        case CR_VBOXHGCM_MEMORY:
    1030 #ifdef CHROMIUM_THREADSAFE
    1031999            crLockMutex(&g_crvboxhgcm.mutex);
    1032 #endif
    10331000            if (g_crvboxhgcm.bufpool) {
    10341001                /** @todo o'rly? */
     
    10381005                crBufferPoolPush(g_crvboxhgcm.bufpool, hgcm_buffer, hgcm_buffer->allocated);
    10391006            }
    1040 #ifdef CHROMIUM_THREADSAFE
    10411007            crUnlockMutex(&g_crvboxhgcm.mutex);
    1042 #endif
    10431008            break;
    10441009
     
    10551020{
    10561021    VBOXCRHGSMIPROFILE_FUNC_PROLOGUE();
    1057 #ifdef CHROMIUM_THREADSAFE
    10581022    crLockMutex(&g_crvboxhgcm.mutex);
    1059 #endif
    10601023    _crVBoxHGCMFree(conn, buf);
    1061 #ifdef CHROMIUM_THREADSAFE
    10621024    crUnlockMutex(&g_crvboxhgcm.mutex);
    1063 #endif
    10641025    VBOXCRHGSMIPROFILE_FUNC_EPILOGUE();
    10651026}
     
    11701131{
    11711132    VBOXCRHGSMIPROFILE_FUNC_PROLOGUE();
    1172 #ifdef CHROMIUM_THREADSAFE
    11731133    crLockMutex(&g_crvboxhgcm.mutex);
    1174 #endif
    11751134    _crVBoxHGCMReceiveMessage(conn);
    1176 #ifdef CHROMIUM_THREADSAFE
    11771135    crUnlockMutex(&g_crvboxhgcm.mutex);
    1178 #endif
    11791136    VBOXCRHGSMIPROFILE_FUNC_EPILOGUE();
    11801137}
     
    14021359    if (!g_crvboxhgcm.initialized) return;
    14031360
    1404 #ifdef CHROMIUM_THREADSAFE
    14051361    crLockMutex(&g_crvboxhgcm.mutex);
    1406 #endif
    1407 
    14081362    VBOXCRHGSMIPROFILE_FUNC_PROLOGUE();
    14091363
     
    14251379    VBOXCRHGSMIPROFILE_FUNC_EPILOGUE();
    14261380
    1427 #ifdef CHROMIUM_THREADSAFE
    14281381    crUnlockMutex(&g_crvboxhgcm.mutex);
    1429 #endif
    14301382}
    14311383
     
    14331385{
    14341386    VBOXCRHGSMIPROFILE_FUNC_PROLOGUE();
    1435 #ifdef CHROMIUM_THREADSAFE
    14361387    crLockMutex(&g_crvboxhgcm.mutex);
    1437 #endif
    14381388    _crVBoxHGCMFree(conn, mess);
    14391389    CRASSERT(FALSE);
    1440 #ifdef CHROMIUM_THREADSAFE
    14411390    crUnlockMutex(&g_crvboxhgcm.mutex);
    1442 #endif
    14431391    VBOXCRHGSMIPROFILE_FUNC_EPILOGUE();
    14441392}
     
    15431491
    15441492    VBOXCRHGSMIPROFILE_FUNC_PROLOGUE();
    1545 
    1546 #ifdef CHROMIUM_THREADSAFE
    15471493    crLockMutex(&g_crvboxhgcm.mutex);
    1548 #endif
    1549 
    15501494    pClient = _crVBoxHGSMIClientGet(conn);
    15511495    if (pClient)
     
    15591503    }
    15601504
    1561 #ifdef CHROMIUM_THREADSAFE
    15621505    crUnlockMutex(&g_crvboxhgcm.mutex);
    1563 #endif
    1564 
    15651506    VBOXCRHGSMIPROFILE_FUNC_EPILOGUE();
    15661507
     
    15711512{
    15721513    VBOXCRHGSMIPROFILE_FUNC_PROLOGUE();
    1573 #ifdef CHROMIUM_THREADSAFE
    15741514    crLockMutex(&g_crvboxhgcm.mutex);
    1575 #endif
    15761515    _crVBoxHGSMIFree(conn, buf);
    1577 #ifdef CHROMIUM_THREADSAFE
    15781516    crUnlockMutex(&g_crvboxhgcm.mutex);
    1579 #endif
    15801517    VBOXCRHGSMIPROFILE_FUNC_EPILOGUE();
    15811518}
     
    19211858    VBOXCRHGSMIPROFILE_FUNC_PROLOGUE();
    19221859
    1923 #ifdef CHROMIUM_THREADSAFE
    19241860    crLockMutex(&g_crvboxhgcm.mutex);
    1925 #endif
    1926 
    19271861    if (!bufp) /* We're sending a user-allocated buffer. */
    19281862    {
     
    19391873            _crVBoxHGSMIWriteReadExact(conn, pClient, (void*)start, 0, len, false);
    19401874#endif
    1941 #ifdef CHROMIUM_THREADSAFE
    19421875            crUnlockMutex(&g_crvboxhgcm.mutex);
    1943 #endif
    19441876            VBOXCRHGSMIPROFILE_FUNC_EPILOGUE();
    19451877            return;
     
    19481880        /* fallback */
    19491881        crVBoxHGCMSend(conn, bufp, start, len);
    1950 #ifdef CHROMIUM_THREADSAFE
    19511882        crUnlockMutex(&g_crvboxhgcm.mutex);
    1952 #endif
    19531883        VBOXCRHGSMIPROFILE_FUNC_EPILOGUE();
    19541884        return;
     
    19671897        /* fallback */
    19681898        crVBoxHGCMSend(conn, bufp, start, len);
    1969 #ifdef CHROMIUM_THREADSAFE
    19701899        crUnlockMutex(&g_crvboxhgcm.mutex);
    1971 #endif
    19721900        VBOXCRHGSMIPROFILE_FUNC_EPILOGUE();
    19731901        return;
     
    19841912    {
    19851913        crVBoxHGCMSend(conn, bufp, start, len);
    1986 #ifdef CHROMIUM_THREADSAFE
    19871914        crUnlockMutex(&g_crvboxhgcm.mutex);
    1988 #endif
    19891915        VBOXCRHGSMIPROFILE_FUNC_EPILOGUE();
    19901916        return;
     
    20191945    *bufp = NULL;
    20201946
    2021 #ifdef CHROMIUM_THREADSAFE
    20221947    crUnlockMutex(&g_crvboxhgcm.mutex);
    2023 #endif
    2024 
    20251948    VBOXCRHGSMIPROFILE_FUNC_EPILOGUE();
    20261949}
     
    20481971    VBOXCRHGSMIPROFILE_FUNC_PROLOGUE();
    20491972
    2050 #ifdef CHROMIUM_THREADSAFE
    20511973    crLockMutex(&g_crvboxhgcm.mutex);
    2052 #endif
    2053 
    20541974    CRASSERT(0);
    20551975
    20561976    _crVBoxHGCMReceiveMessage(conn);
    20571977
    2058 #ifdef CHROMIUM_THREADSAFE
    20591978    crUnlockMutex(&g_crvboxhgcm.mutex);
    2060 #endif
    2061 
    20621979    VBOXCRHGSMIPROFILE_FUNC_EPILOGUE();
    20631980}
     
    20832000    int rc = VINF_SUCCESS;
    20842001
    2085 #ifdef CHROMIUM_THREADSAFE
    20862002    crLockMutex(&g_crvboxhgcm.mutex);
    2087 #endif
    2088 
    20892003    VBOXCRHGSMIPROFILE_FUNC_PROLOGUE();
    20902004
     
    21192033    VBOXCRHGSMIPROFILE_FUNC_EPILOGUE();
    21202034
    2121 #ifdef CHROMIUM_THREADSAFE
    21222035    crUnlockMutex(&g_crvboxhgcm.mutex);
    2123 #endif
    21242036    return RT_SUCCESS(rc);
    21252037}
     
    21332045    VBOXCRHGSMIPROFILE_FUNC_PROLOGUE();
    21342046
    2135 #ifdef CHROMIUM_THREADSAFE
    21362047    crLockMutex(&g_crvboxhgcm.mutex);
    2137 #endif
    2138 
    21392048    fHasActiveCons = _crVBoxCommonDoDisconnectLocked(conn);
    21402049
     
    21532062
    21542063    VBOXCRHGSMIPROFILE_FUNC_EPILOGUE();
    2155 
    2156 #ifdef CHROMIUM_THREADSAFE
    21572064    crUnlockMutex(&g_crvboxhgcm.mutex);
    2158 #endif
    21592065}
    21602066
     
    21622068{
    21632069    VBOXCRHGSMIPROFILE_FUNC_PROLOGUE();
    2164 #ifdef CHROMIUM_THREADSAFE
    21652070    crLockMutex(&g_crvboxhgcm.mutex);
    2166 #endif
    21672071    CRASSERT(0);
    21682072
    21692073    _crVBoxHGSMIFree(conn, mess);
    21702074
    2171 #ifdef CHROMIUM_THREADSAFE
    21722075    crUnlockMutex(&g_crvboxhgcm.mutex);
    2173 #endif
    21742076    VBOXCRHGSMIPROFILE_FUNC_EPILOGUE();
    21752077}
     
    22122114#endif
    22132115
    2214 #ifdef CHROMIUM_THREADSAFE
    22152116    crInitMutex(&g_crvboxhgcm.mutex);
    22162117    crInitMutex(&g_crvboxhgcm.recvmutex);
    2217 #endif
    22182118    g_crvboxhgcm.bufpool = crBufferPoolInit(16);
    22192119
     
    22532153    if (!g_crvboxhgcm.initialized) return;
    22542154
    2255 #ifdef CHROMIUM_THREADSAFE
    22562155    crLockMutex(&g_crvboxhgcm.mutex);
    2257 #endif
    22582156
    22592157    /* Connection count would be changed in calls to crNetDisconnect, so we have to store original value.
     
    22752173    g_crvboxhgcm.bufpool = NULL;
    22762174
    2277 #ifdef CHROMIUM_THREADSAFE
    22782175    crUnlockMutex(&g_crvboxhgcm.mutex);
    22792176    crFreeMutex(&g_crvboxhgcm.mutex);
    22802177    crFreeMutex(&g_crvboxhgcm.recvmutex);
    2281 #endif
    22822178
    22832179    crFree(g_crvboxhgcm.conns);
     
    23642260#endif
    23652261
    2366 #ifdef CHROMIUM_THREADSAFE
    23672262    crLockMutex(&g_crvboxhgcm.mutex);
    2368 #endif
     2263
    23692264    /* Find a free slot */
    23702265    for (i = 0; i < g_crvboxhgcm.num_conns; i++) {
     
    23842279        g_crvboxhgcm.conns[g_crvboxhgcm.num_conns++] = conn;
    23852280    }
    2386 #ifdef CHROMIUM_THREADSAFE
    23872281    crUnlockMutex(&g_crvboxhgcm.mutex);
    2388 #endif
    23892282}
    23902283
     
    24432336    VBOXCRHGSMIPROFILE_FUNC_PROLOGUE();
    24442337
    2445 #ifdef CHROMIUM_THREADSAFE
    24462338    crLockMutex(&g_crvboxhgcm.mutex);
    2447 #endif
    24482339
    24492340#ifdef IN_GUEST
     
    24792370    }
    24802371
    2481 #ifdef CHROMIUM_THREADSAFE
    24822372    crUnlockMutex(&g_crvboxhgcm.mutex);
    2483 #endif
    2484 
    24852373    VBOXCRHGSMIPROFILE_FUNC_EPILOGUE();
    24862374
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