VirtualBox

Changeset 78341 in vbox for trunk/src/VBox/Additions/common


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

Location:
trunk/src/VBox/Additions/common/crOpenGL
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/crOpenGL/context.c

    r78190 r78341  
    3535 * we're in a multi-thread situation, and do the right thing for dispatch.
    3636 */
    37 #ifdef CHROMIUM_THREADSAFE
    38     static void
    39 stubCheckMultithread( void )
     37static void stubCheckMultithread( void )
    4038{
    4139    static unsigned long knownID;
     
    5553    }
    5654}
    57 #endif
    5855
    5956
     
    6663    CRASSERT(table);
    6764
    68 #ifdef CHROMIUM_THREADSAFE
    6965    /* always set the per-thread dispatch pointer */
    7066    crSetTSD(&stub.dispatchTSD, (void *) table);
     
    7571    }
    7672    else
    77 #endif
    7873    {
    7974    /* Single thread mode - just install the caller's dispatch table */
     
    468463}
    469464
    470 #ifdef CHROMIUM_THREADSAFE
    471465static DECLCALLBACK(void) stubContextDtor(void*pvContext)
    472466{
    473467    stubContextFree((ContextInfo*)pvContext);
    474468}
    475 #endif
    476469
    477470/**
     
    549542#endif
    550543
    551 #ifdef CHROMIUM_THREADSAFE
    552544    VBoxTlsRefInit(context, stubContextDtor);
    553 #endif
    554545
    555546#if defined(GLX) || defined(DARWIN)
     
    11811172    }
    11821173
    1183 #ifdef CHROMIUM_THREADSAFE
    11841174    stubCheckMultithread();
    1185 #endif
    11861175
    11871176    if (context->type == UNDECIDED) {
    11881177        /* Here's where we really create contexts */
    1189 #ifdef CHROMIUM_THREADSAFE
    11901178        crLockMutex(&stub.mutex);
    1191 #endif
    11921179
    11931180        if (stubCheckUseChromium(window)) {
     
    12201207            if (!InstantiateNativeContext(window, context))
    12211208            {
    1222 # ifdef CHROMIUM_THREADSAFE
    12231209                crUnlockMutex(&stub.mutex);
    1224 # endif
    12251210                return 0; /* false */
    12261211            }
     
    12291214#endif /* !GLX */
    12301215
    1231 #ifdef CHROMIUM_THREADSAFE
    12321216        crUnlockMutex(&stub.mutex);
    1233 #endif
    12341217    }
    12351218
     
    14081391        crError("No context.");
    14091392
    1410 #ifdef CHROMIUM_THREADSAFE
    14111393    if (stubGetCurrentContext() == context) {
    14121394        stubSetCurrentContext(NULL);
     
    14151397    VBoxTlsRefMarkDestroy(context);
    14161398    VBoxTlsRefRelease(context);
    1417 #else
    1418     if (stubGetCurrentContext() == context) {
    1419         stubSetCurrentContext(NULL);
    1420     }
    1421     stubContextFree(context);
    1422 #endif
    14231399    crHashtableUnlock(stub.contextTable);
    14241400    crHashtableUnlock(stub.windowTable);
  • trunk/src/VBox/Additions/common/crOpenGL/feedback/feedback_context.c

    r76553 r78341  
    3636    GLint ctx, slot;
    3737
    38 #ifdef CHROMIUM_THREADSAFE
    3938    crLockMutex(&feedback_spu.mutex);
    40 #endif
    41 
    4239    ctx = feedback_spu.child.VBoxCreateContext(con, dpyName, visual, shareCtx);
    4340
     
    5653    feedback_spu.context[slot].clientCtx = ctx;
    5754
    58 #ifdef CHROMIUM_THREADSAFE
    5955    crUnlockMutex(&feedback_spu.mutex);
    60 #endif
    61 
    6256    return ctx;
    6357}
     
    7266feedbackspu_MakeCurrent( GLint window, GLint nativeWindow, GLint ctx )
    7367{
    74 #ifdef CHROMIUM_THREADSAFE
    7568    crLockMutex(&feedback_spu.mutex);
    76 #endif
    7769    feedback_spu.child.MakeCurrent(window, nativeWindow, ctx);
    7870
     
    9991    }
    10092
    101 #ifdef CHROMIUM_THREADSAFE
    10293    crUnlockMutex(&feedback_spu.mutex);
    103 #endif
    10494}
    10595
     
    10797feedbackspu_DestroyContext( GLint ctx )
    10898{
    109 #ifdef CHROMIUM_THREADSAFE
    11099    crLockMutex(&feedback_spu.mutex);
    111 #endif
    112100    feedback_spu.child.DestroyContext(ctx);
    113101
     
    125113    }
    126114
    127 #ifdef CHROMIUM_THREADSAFE
    128115    crUnlockMutex(&feedback_spu.mutex);
    129 #endif
    130116}
    131117
  • trunk/src/VBox/Additions/common/crOpenGL/feedback/feedbackspu.h

    r78190 r78341  
    4242    ContextInfo context[CR_MAX_CONTEXTS];
    4343
    44 #ifdef CHROMIUM_THREADSAFE
    4544    CRmutex mutex;
    46 #endif
    4745} feedbackSPU;
    4846
  • trunk/src/VBox/Additions/common/crOpenGL/feedback/feedbackspu_init.c

    r78190 r78341  
    3131        (void) num_contexts;
    3232
    33 #ifdef CHROMIUM_THREADSAFE
    3433    crInitMutex(&feedback_spu.mutex);
    35 #endif
    36 
    3734        feedback_spu.id = id;
    3835        feedback_spu.has_child = 0;
  • trunk/src/VBox/Additions/common/crOpenGL/load.c

    r78190 r78341  
    6363/* NOTE: 'SPUDispatchTable stubThreadsafeDispatch' is declared in tsfuncs.c */
    6464Stub stub;
    65 #ifdef CHROMIUM_THREADSAFE
    6665static bool g_stubIsCurrentContextTSDInited;
    6766CRtsd g_stubCurrentContextTSD;
    68 #endif
    69 
    7067
    7168#ifndef VBOX_NO_NATIVEGL
     
    392389static void stubSPUSafeTearDown(void)
    393390{
    394 #ifdef CHROMIUM_THREADSAFE
    395391    CRmutex *mutex;
    396 #endif
    397392
    398393    if (!stub_initialized) return;
    399394    stub_initialized = 0;
    400395
    401 #ifdef CHROMIUM_THREADSAFE
    402396    mutex = &stub.mutex;
    403397    crLockMutex(mutex);
    404 #endif
    405398    crDebug("stubSPUSafeTearDown");
    406399
     
    489482#endif
    490483
    491 #ifdef CHROMIUM_THREADSAFE
    492484    crUnlockMutex(mutex);
    493485    crFreeMutex(mutex);
    494 #endif
    495486    crMemset(&stub, 0, sizeof(stub));
    496487}
     
    515506
    516507#ifndef RT_OS_WINDOWS
    517 # ifdef CHROMIUM_THREADSAFE
    518508static void stubThreadTlsDtor(void *pvValue)
    519509{
     
    521511    VBoxTlsRefRelease(pCtx);
    522512}
    523 # endif
    524513#endif
    525514
     
    532521    WindowInfo *defaultWin;
    533522
    534 #ifdef CHROMIUM_THREADSAFE
    535523    crInitMutex(&stub.mutex);
    536 #endif
    537524
    538525    /* At the very least we want CR_RGB_BIT. */
     
    559546    stub.contextTable = crAllocHashtable();
    560547#ifndef RT_OS_WINDOWS
    561 # ifdef CHROMIUM_THREADSAFE
    562548    if (!g_stubIsCurrentContextTSDInited)
    563549    {
     
    565551        g_stubIsCurrentContextTSDInited = true;
    566552    }
    567 # endif
    568553#endif
    569554    stubSetCurrentContext(NULL);
     
    12021187        crDbgCmdSymLoadPrint("VBoxOGLcrutil.dll", hCrUtil);
    12031188#endif
    1204 #ifdef CHROMIUM_THREADSAFE
    12051189        crInitTSD(&g_stubCurrentContextTSD);
    1206 #endif
    1207 
    12081190        crInitMutex(&stub_init_mutex);
    12091191
     
    13471329
    13481330        stubSPUSafeTearDown();
    1349 
    1350 #ifdef CHROMIUM_THREADSAFE
    13511331        crFreeTSD(&g_stubCurrentContextTSD);
    1352 #endif
    13531332
    13541333#ifdef VDBG_VEHANDLER
  • trunk/src/VBox/Additions/common/crOpenGL/pack/packspu.h

    r78190 r78341  
    115115#define THREAD_OFFSET_MAGIC 2000
    116116
    117 #ifdef CHROMIUM_THREADSAFE
    118117extern CRmutex _PackMutex;
    119118extern CRtsd _PackTSD;
     
    121120#define GET_THREAD_IDX(_id) ((_id) - THREAD_OFFSET_MAGIC)
    122121#define GET_THREAD_VAL_ID(_id) (&(pack_spu.thread[GET_THREAD_IDX(_id)]))
    123 #else
    124 #define GET_THREAD_VAL()  (&(pack_spu.thread[0]))
    125 #endif
    126122#define GET_THREAD(T)  ThreadInfo *T = GET_THREAD_VAL()
    127123#define GET_THREAD_ID(T, _id) ThreadInfo *T = GET_THREAD_VAL_ID(_id)
  • trunk/src/VBox/Additions/common/crOpenGL/pack/packspu_context.c

    r78190 r78341  
    2929    int i;
    3030
    31 #ifdef CHROMIUM_THREADSAFE
    3231    crLockMutex(&_PackMutex);
    33 #else
    34     CRASSERT(pack_spu.numThreads == 0);
    35 #endif
    3632
    3733#if defined(VBOX_WITH_CRHGSMI) && defined(IN_GUEST)
     
    8581
    8682
    87 #ifdef CHROMIUM_THREADSAFE
    8883    if (!CRPACKSPU_IS_WDDM_CRHGSMI())
    8984    {
    9085        crSetTSD(&_PackTSD, thread);
    9186    }
    92 #endif
    9387
    9488    pack_spu.numThreads++;
    9589
    96 #ifdef CHROMIUM_THREADSAFE
    9790    crUnlockMutex(&_PackMutex);
    98 #endif
    9991    return thread;
    10092}
     
    199191    CRASSERT(!curThread == !curPacker);
    200192    CRASSERT(!curThread || !curPacker || curThread->packer == curPacker);
    201 #ifdef CHROMIUM_THREADSAFE
    202193    crLockMutex(&_PackMutex);
    203 #endif
    204194
    205195#if defined(VBOX_WITH_CRHGSMI) && defined(IN_GUEST)
     
    235225    packspu_ChromiumParameteriCR(param, value);
    236226
    237 #ifdef CHROMIUM_THREADSAFE
    238227    crUnlockMutex(&_PackMutex);
    239 #endif
    240 
    241228    if (CRPACKSPU_IS_WDDM_CRHGSMI())
    242229    {
     
    255242    CRASSERT(!curThread == !curPacker);
    256243    CRASSERT(!curThread || !curPacker || curThread->packer == curPacker);
    257 #ifdef CHROMIUM_THREADSAFE
    258244    crLockMutex(&_PackMutex);
    259 #endif
    260245
    261246#if defined(VBOX_WITH_CRHGSMI) && defined(IN_GUEST)
     
    291276    packspu_ChromiumParametervCR(target, type, count, values);
    292277
    293 #ifdef CHROMIUM_THREADSAFE
    294278    crUnlockMutex(&_PackMutex);
    295 #endif
    296 
    297279    if (CRPACKSPU_IS_WDDM_CRHGSMI())
    298280    {
     
    314296    CRASSERT(!curThread == !curPacker);
    315297    CRASSERT(!curThread || !curPacker || curThread->packer == curPacker);
    316 #ifdef CHROMIUM_THREADSAFE
    317298    crLockMutex(&_PackMutex);
    318 #endif
    319299
    320300#if defined(VBOX_WITH_CRHGSMI) && defined(IN_GUEST)
     
    383363
    384364        if (serverCtx < 0) {
    385 #ifdef CHROMIUM_THREADSAFE
    386365            crUnlockMutex(&_PackMutex);
    387 #endif
    388366            crWarning("Failure in packspu_CreateContext");
    389367
     
    420398    pack_spu.context[slot].serverCtx = serverCtx;
    421399
    422 #ifdef CHROMIUM_THREADSAFE
    423400    crUnlockMutex(&_PackMutex);
    424 #endif
    425 
    426401    if (CRPACKSPU_IS_WDDM_CRHGSMI())
    427402    {
  • trunk/src/VBox/Additions/common/crOpenGL/pack/packspu_init.c

    r78190 r78341  
    2222PackSPU pack_spu;
    2323
    24 #ifdef CHROMIUM_THREADSAFE
    2524CRtsd _PackTSD;
    2625CRmutex _PackMutex;
    27 #endif
    2826
    2927#if defined(VBOX_WITH_CRHGSMI) && defined(IN_GUEST)
     
    5957    (void) self;
    6058
    61 #if defined(CHROMIUM_THREADSAFE) && !defined(WINDOWS)
     59#if !defined(WINDOWS)
    6260    crInitMutex(&_PackMutex);
    6361#endif
    6462
    65 #ifdef CHROMIUM_THREADSAFE
    6663    crInitTSD(&_PackerTSD);
    6764    crInitTSD(&_PackTSD);
    68 #endif
    6965
    7066    pack_spu.id = id;
     
    113109{
    114110    int i;
    115 #ifdef CHROMIUM_THREADSAFE
    116111    crLockMutex(&_PackMutex);
    117 #endif
    118112    for (i=0; i<MAX_THREADS; ++i)
    119113    {
     
    124118    }
    125119
    126 #ifdef CHROMIUM_THREADSAFE
    127120    crFreeTSD(&_PackerTSD);
    128121    crFreeTSD(&_PackTSD);
    129122    crUnlockMutex(&_PackMutex);
    130 # ifndef WINDOWS
     123#ifndef WINDOWS
    131124    crFreeMutex(&_PackMutex);
    132 # endif
    133 #endif /* CHROMIUM_THREADSAFE */
     125#endif
    134126    return 1;
    135127}
  • trunk/src/VBox/Additions/common/crOpenGL/pack/packspu_misc.c

    r78190 r78341  
    495495}
    496496
    497 #ifdef CHROMIUM_THREADSAFE
    498497GLint PACKSPU_APIENTRY packspu_VBoxPackSetInjectThread(struct VBOXUHGSMI *pHgsmi)
    499498{
     
    737736#endif
    738737
    739 #else  /*ifdef CHROMIUM_THREADSAFE*/
    740 GLint PACKSPU_APIENTRY packspu_VBoxPackSetInjectThread(struct VBOXUHGSMI *pHgsmi)
    741 {
    742 }
    743 
    744 GLuint PACKSPU_APIENTRY packspu_VBoxPackGetInjectID(GLint con)
    745 {
    746     return 0;
    747 }
    748 
    749 void PACKSPU_APIENTRY packspu_VBoxPackSetInjectID(GLuint id)
    750 {
    751     (void) id;
    752 }
    753 
    754 void PACKSPU_APIENTRY packspu_VBoxPackAttachThread()
    755 {
    756 }
    757 
    758 void PACKSPU_APIENTRY packspu_VBoxPackDetachThread()
    759 {
    760 }
    761 #endif /*CHROMIUM_THREADSAFE*/
    762 
    763738void PACKSPU_APIENTRY packspu_VBoxPresentComposition(GLint win, const struct VBOXVR_SCR_COMPOSITOR * pCompositor,
    764739                                                     const struct VBOXVR_SCR_COMPOSITOR_ENTRY *pChangedEntry)
  • trunk/src/VBox/Additions/common/crOpenGL/pack/packspu_net.c

    r78190 r78341  
    118118    /* we should _always_ pass a valid <arg> value */
    119119    CRASSERT(thread && thread->inUse);
    120 #ifdef CHROMIUM_THREADSAFE
    121120    CR_LOCK_PACKER_CONTEXT(thread->packer);
    122 #endif
    123121    ctx = thread->currentContext;
    124122    buf = &(thread->buffer);
     
    145143           crPackSetBuffer( thread->packer, buf );
    146144           crPackResetPointers(thread->packer);
    147 #ifdef CHROMIUM_THREADSAFE
    148145           CR_UNLOCK_PACKER_CONTEXT(thread->packer);
    149 #endif
    150146           return;
    151147    }
     
    174170
    175171    crPackResetPointers(thread->packer);
    176 
    177 #ifdef CHROMIUM_THREADSAFE
    178172    CR_UNLOCK_PACKER_CONTEXT(thread->packer);
    179 #endif
    180173}
    181174
  • trunk/src/VBox/Additions/common/crOpenGL/stub.h

    r76563 r78341  
    5454#endif
    5555
    56 #if !defined(CHROMIUM_THREADSAFE) && defined(CR_NEWWINTRACK)
    57 # error CHROMIUM_THREADSAFE have to be defined
    58 #endif
    59 
    60 #ifdef CHROMIUM_THREADSAFE
    61 # include <cr_threads.h>
    62 #endif
     56#include <cr_threads.h>
    6357
    6458#if 0 && defined(CR_NEWWINTRACK) && !defined(WINDOWS)
     
    121115#endif
    122116
    123 #ifdef CHROMIUM_THREADSAFE
    124117    VBOXTLSREFDATA
    125 #endif
    126118
    127119#ifdef WINDOWS
     
    225217    /* thread safety stuff */
    226218    GLboolean threadSafe;
    227 #ifdef CHROMIUM_THREADSAFE
    228219    CRtsd dispatchTSD;
    229220    CRmutex mutex;
    230 #endif
    231221
    232222    CRpid mothershipPID;
     
    235225    int freeContextNumber;
    236226    CRHashTable *contextTable;
    237 #ifndef CHROMIUM_THREADSAFE
    238     ContextInfo *currentContext; /* may be NULL */
    239 #endif
    240227
    241228    /* windows */
     
    270257} Stub;
    271258
    272 #ifdef CHROMIUM_THREADSAFE
    273259/* we place the g_stubCurrentContextTLS outside the Stub data because Stub data is inited by the client's call,
    274260 * while we need g_stubCurrentContextTLS the g_stubCurrentContextTLS to be valid at any time to be able to handle
     
    291277}
    292278# define stubSetCurrentContext(_ctx) VBoxTlsRefSetCurrent(ContextInfo, &g_stubCurrentContextTSD, _ctx)
    293 #else
    294 # define stubGetCurrentContext() (stub.currentContext)
    295 # define stubSetCurrentContext(_ctx) do { stub.currentContext = (_ctx); } while (0)
    296 #endif
    297279
    298280extern Stub stub;
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