VirtualBox

Changeset 78341 in vbox for trunk


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
Files:
26 edited

Legend:

Unmodified
Added
Removed
  • trunk/Config.kmk

    r78336 r78341  
    73457345TEMPLATE_VBOXCROGLR3HOSTDLL_EXTENDS         := $(if-expr "$(KBUILD_TARGET)" == "win",VBOXR3,VBOXR3NP)
    73467346TEMPLATE_VBOXCROGLR3HOSTDLL_EXTENDS_BY       = prepending
    7347 TEMPLATE_VBOXCROGLR3HOSTDLL_DEFS             = CHROMIUM_THREADSAFE VBOX_WITH_HGCM UNPACKS
     7347TEMPLATE_VBOXCROGLR3HOSTDLL_DEFS             = VBOX_WITH_HGCM UNPACKS
    73487348TEMPLATE_VBOXCROGLR3HOSTDLL_DEFS.win         = _WIN32_WINNT=0x0500 WINDOWS=1
    73497349TEMPLATE_VBOXCROGLR3HOSTDLL_DEFS.linux       = Linux=1 _GNU_SOURCE
     
    73887388TEMPLATE_VBOXCROGLR3GUESTDLL_EXTENDS          = VBOXGUESTR3NPDLL
    73897389#endif
    7390 TEMPLATE_VBOXCROGLR3GUESTDLL_DEFS             = $(TEMPLATE_$(TEMPLATE_VBOXCROGLR3GUESTDLL_EXTENDS)_DEFS) CHROMIUM_THREADSAFE VBOX_WITH_HGCM
     7390TEMPLATE_VBOXCROGLR3GUESTDLL_DEFS             = $(TEMPLATE_$(TEMPLATE_VBOXCROGLR3GUESTDLL_EXTENDS)_DEFS) VBOX_WITH_HGCM
    73917391TEMPLATE_VBOXCROGLR3GUESTDLL_DEFS.win         = $(TEMPLATE_$(TEMPLATE_VBOXCROGLR3GUESTDLL_EXTENDS)_DEFS.win) WINDOWS=1
    73927392TEMPLATE_VBOXCROGLR3GUESTDLL_DEFS.linux       = $(TEMPLATE_$(TEMPLATE_VBOXCROGLR3GUESTDLL_EXTENDS)_DEFS.linux) Linux=1 _GNU_SOURCE
  • 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;
  • trunk/src/VBox/GuestHost/OpenGL/include/cr_glstate.h

    r69474 r78341  
    4646#include "spu_dispatch_table.h"
    4747
    48 #ifdef CHROMIUM_THREADSAFE
    49 # include <cr_threads.h>
    50 #endif
     48#include "cr_threads.h"
    5149
    5250#include <iprt/cdefs.h>
     
    132130    int id;
    133131
    134 #ifdef CHROMIUM_THREADSAFE
    135132    /* we keep reference counting of context's makeCurrent for different threads
    136133     * this is primarily needed to avoid having an invalid memory reference in the TLS
     
    143140     * */
    144141    VBOXTLSREFDATA
    145 #endif
    146142
    147143    CRbitvalue bitid[CR_MAX_BITARRAY];
  • trunk/src/VBox/GuestHost/OpenGL/include/cr_pack.h

    r78190 r78341  
    1515#include "state/cr_currentpointers.h"
    1616#include "state/cr_client.h"
    17 #ifdef CHROMIUM_THREADSAFE
    1817#include "cr_threads.h"
    19 #endif
    2018
    2119#include <iprt/types.h>
     
    8482    int updateBBOX;
    8583    CRPackBuffer *currentBuffer;
    86 #ifdef CHROMIUM_THREADSAFE
    8784    CRmutex mutex;
    88 #endif
    8985    char *file;  /**< for debugging only */
    9086    int line;    /**< for debugging only */
     
    9793# define CR_PACKER_CONTEXT_ARG_NOREF()  do {} while (0)
    9894# define CR_PACKER_CONTEXT_ARGCTX(C)
    99 # ifdef CHROMIUM_THREADSAFE
    10095extern CRtsd _PackerTSD;
    101 #  define CR_GET_PACKER_CONTEXT(C) CRPackContext *C = (CRPackContext *) crGetTSD(&_PackerTSD)
    102 #  define CR_LOCK_PACKER_CONTEXT(PC) crLockMutex(&((PC)->mutex))
    103 #  define CR_UNLOCK_PACKER_CONTEXT(PC) crUnlockMutex(&((PC)->mutex))
    104 # else
    105 extern DLLDATA(CRPackContext) cr_packer_globals;
    106 #  define CR_GET_PACKER_CONTEXT(C) CRPackContext *C = &cr_packer_globals
    107 #  define CR_LOCK_PACKER_CONTEXT(PC)
    108 #  define CR_UNLOCK_PACKER_CONTEXT(PC)
    109 # endif
     96# define CR_GET_PACKER_CONTEXT(C) CRPackContext *C = (CRPackContext *) crGetTSD(&_PackerTSD)
     97# define CR_LOCK_PACKER_CONTEXT(PC) crLockMutex(&((PC)->mutex))
     98# define CR_UNLOCK_PACKER_CONTEXT(PC) crUnlockMutex(&((PC)->mutex))
    11099extern uint32_t cr_packer_cmd_blocks_enabled;
    111100#else /* if defined IN_RING0 */
  • trunk/src/VBox/GuestHost/OpenGL/packer/pack_buffer.c

    r78190 r78341  
    374374    CR_UNLOCK_PACKER_CONTEXT(pc);
    375375}
    376 
    377 
    378 #ifndef CHROMIUM_THREADSAFE
    379 static unsigned char *sanityCheckPointer = NULL;
    380 #endif
    381376
    382377
     
    452447
    453448        *((unsigned int *) data_ptr) = size;
    454 #ifndef CHROMIUM_THREADSAFE
    455         sanityCheckPointer = data_ptr + 4;
    456 #endif
    457449        return data_ptr + 4;
    458450}
     
    469461{
    470462        CR_GET_PACKER_CONTEXT(pc);
    471 #ifndef CHROMIUM_THREADSAFE
    472         CRASSERT(sanityCheckPointer == packet);
    473         sanityCheckPointer = NULL;
    474 #endif
    475463
    476464        if ( IS_BUFFERED( packet ) )
  • trunk/src/VBox/GuestHost/OpenGL/packer/pack_init.c

    r78190 r78341  
    1010#include <stdio.h>
    1111
    12 #ifdef CHROMIUM_THREADSAFE
    1312CRtsd _PackerTSD;
    1413int cr_packer_globals;  /* dummy - for the sake of packer.def */
    15 #else
    16 int _PackerTSD;         /* dummy - for the sake of packer.def */  /* drm1 */
    17 DLLDATA(CRPackContext) cr_packer_globals;
    18 #endif
    19 
    2014uint32_t cr_packer_cmd_blocks_enabled = 0;
    2115
    2216CRPackContext *crPackNewContext(void)
    2317{
    24 #ifdef CHROMIUM_THREADSAFE
    2518    CRPackContext *pc = crCalloc(sizeof(CRPackContext));
    2619    if (!pc)
    2720        return NULL;
    2821    crInitMutex(&pc->mutex);
    29 #else
    30     GET_PACKER_CONTEXT(pc);
    31         crMemZero( pc, sizeof(CRPackContext));
    32 #endif
    3322    pc->u32CmdBlockState = 0;
    3423    pc->Flush = NULL;
     
    4029void crPackDeleteContext(CRPackContext *pc)
    4130{
    42 #ifdef CHROMIUM_THREADSAFE
    4331    crFreeMutex(&pc->mutex);
    4432    crFree(pc);
    45 #endif
    4633}
    4734
     
    4936void crPackSetContext( CRPackContext *pc )
    5037{
    51 #ifdef CHROMIUM_THREADSAFE
    5238    crSetTSD( &_PackerTSD, pc );
    53 #else
    54     CRASSERT( pc == &cr_packer_globals );
    55     (void)pc;
    56 #endif
    5739}
    5840
     
    6143CRPackContext *crPackGetContext( void )
    6244{
    63 #ifdef CHROMIUM_THREADSAFE
    6445    return (CRPackContext *) crGetTSD( &_PackerTSD );
    65 #else
    66     return &cr_packer_globals;
    67 #endif
    6846}
    6947
  • trunk/src/VBox/GuestHost/OpenGL/state_tracker/state.h

    r69474 r78341  
    2929#define GetCurrentBits() __currentBits
    3030
    31 #ifdef CHROMIUM_THREADSAFE
    3231#include <cr_threads.h>
    3332
     
    3938 * (i.e. state_glsl.c) is using it */
    4039#define SetCurrentContext(_ctx) VBoxTlsRefSetCurrent(CRContext, &__contextTSD, _ctx)
    41 #else
    42 extern CRContext *__currentContext;
    43 #define GetCurrentContext() __currentContext
    44 #endif
    4540
    4641extern GLboolean g_bVBoxEnableDiffOnMakeCurrent;
  • trunk/src/VBox/GuestHost/OpenGL/state_tracker/state_glsl.c

    r78263 r78341  
    192192    /** @todo hack to allow crStateFreeGLSLProgram to work correctly,
    193193      as the current context isn't the one being destroyed*/
    194 #ifdef CHROMIUM_THREADSAFE
    195194    CRASSERT(g != ctx);
    196195    VBoxTlsRefAddRef(ctx); /* <- this is a hack to avoid subsequent SetCurrentContext(g) do recursive Destroy for ctx */
     
    198197        VBoxTlsRefAddRef(g); /* <- ensure the g is not destroyed by the following SetCurrentContext call */
    199198    SetCurrentContext(ctx);
    200 #else
    201     __currentContext = ctx;
    202 #endif
    203199
    204200    crFreeHashtable(ctx->glsl.programs, crStateFreeGLSLProgram);
    205201    crFreeHashtable(ctx->glsl.shaders, crStateFreeGLSLShader);
    206202
    207 #ifdef CHROMIUM_THREADSAFE
    208203    SetCurrentContext(g);
    209204    if (g)
    210205        VBoxTlsRefRelease(g);
    211206    VBoxTlsRefRelease(ctx); /* <- restore back the cRefs (see above) */
    212 #else
    213     __currentContext = g;
    214 #endif
    215 
    216207}
    217208
  • trunk/src/VBox/GuestHost/OpenGL/state_tracker/state_init.c

    r78263 r78341  
    1212#include <iprt/asm.h>
    1313
    14 #ifdef CHROMIUM_THREADSAFE
    1514static bool __isContextTLSInited = false;
    1615CRtsd __contextTSD;
    17 #else
    18 CRContext *__currentContext = NULL;
    19 #endif
    2016
    2117CRStateBits *__currentBits = NULL;
     
    297293}
    298294
    299 #ifdef CHROMIUM_THREADSAFE
    300 static void
    301 crStateFreeContext(CRContext *ctx);
     295static void crStateFreeContext(CRContext *ctx);
     296
    302297static DECLCALLBACK(void) crStateContextDtor(void *pvCtx)
    303298{
    304299    crStateFreeContext((CRContext*)pvCtx);
    305300}
    306 #endif
    307301
    308302/*
     
    334328    CRASSERT(g_cContexts < RT_ELEMENTS(g_pAvailableContexts));
    335329    ctx->id = i;
    336 #ifdef CHROMIUM_THREADSAFE
    337330    VBoxTlsRefInit(ctx, crStateContextDtor);
    338 #endif
    339331    ctx->flush_func = NULL;
    340332    for (j=0;j<CR_MAX_BITARRAY;j++){
     
    474466}
    475467
    476 #ifdef CHROMIUM_THREADSAFE
    477 # ifndef RT_OS_WINDOWS
     468#ifndef RT_OS_WINDOWS
    478469static void crStateThreadTlsDtor(void *pvValue)
    479470{
     
    481472    VBoxTlsRefRelease(pCtx);
    482473}
    483 # endif
    484474#endif
    485475
     
    513503    g_cContexts = 0;
    514504
    515 #ifdef CHROMIUM_THREADSAFE
    516505    if (!__isContextTLSInited)
    517506    {
     
    525514        __isContextTLSInited = 1;
    526515    }
    527 #endif
    528516
    529517    if (defaultContext) {
    530518        /* Free the default/NULL context.
    531519         * Ensures context bits are reset */
    532 #ifdef CHROMIUM_THREADSAFE
    533520        SetCurrentContext(NULL);
    534521        VBoxTlsRefRelease(defaultContext);
    535 #else
    536         crStateFreeContext(defaultContext);
    537         __currentContext = NULL;
    538 #endif
    539522    }
    540523
     
    550533    CRASSERT(g_pAvailableContexts[0] == defaultContext);
    551534    CRASSERT(g_cContexts == 1);
    552 #ifdef CHROMIUM_THREADSAFE
    553535    SetCurrentContext(defaultContext);
    554 #else
    555     __currentContext = defaultContext;
    556 #endif
    557536}
    558537
     
    574553        if (g_pAvailableContexts[i])
    575554        {
    576 #ifdef CHROMIUM_THREADSAFE
    577555            if (VBoxTlsRefIsFunctional(g_pAvailableContexts[i]))
    578556                VBoxTlsRefRelease(g_pAvailableContexts[i]);
    579 #else
    580             crStateFreeContext(g_pAvailableContexts[i]);
    581 #endif
    582557        }
    583558    }
     
    587562
    588563
    589 #ifdef CHROMIUM_THREADSAFE
    590564    crFreeTSD(&__contextTSD);
    591565    __isContextTLSInited = 0;
    592 #endif
    593566}
    594567
     
    692665        if (diff_api.AlphaFunc)
    693666            crStateSwitchContext(current, defaultContext);
    694 #ifdef CHROMIUM_THREADSAFE
     667
    695668        SetCurrentContext(defaultContext);
    696 #else
    697         __currentContext = defaultContext;
    698 #endif
    699669        /* ensure matrix state is also current */
    700670        crStateMatrixMode(defaultContext->transform.matrixMode);
    701671    }
    702672
    703 #ifdef CHROMIUM_THREADSAFE
    704673    VBoxTlsRefMarkDestroy(ctx);
    705674# ifdef IN_GUEST
     
    712681# endif
    713682    VBoxTlsRefRelease(ctx);
    714 #else
    715     crStateFreeContext(ctx);
    716 #endif
    717683}
    718684
     
    744710    }
    745711
    746 #ifdef CHROMIUM_THREADSAFE
    747712    SetCurrentContext(pLocalCtx);
    748 #else
    749     __currentContext = pLocalCtx;
    750 #endif
    751713
    752714    /* ensure matrix state is also current */
     
    769731        return; /* no-op */
    770732
    771 #ifdef CHROMIUM_THREADSAFE
    772733    SetCurrentContext(pLocalCtx);
    773 #else
    774     __currentContext = pLocalCtx;
    775 #endif
    776 
    777734    if (pLocalCtx)
    778735    {
  • trunk/src/VBox/GuestHost/OpenGL/util/hash.c

    r63199 r78341  
    3737
    3838struct CRHashTable {
    39         unsigned int num_elements;
    40         CRHashNode *buckets[CR_NUM_BUCKETS];
    41         CRHashIdPool   *idPool;
    42 #ifdef CHROMIUM_THREADSAFE
     39    unsigned int num_elements;
     40    CRHashNode *buckets[CR_NUM_BUCKETS];
     41    CRHashIdPool   *idPool;
    4342    CRmutex mutex;
    44 #endif
    4543};
    4644
     
    382380    }
    383381    hash->idPool = crAllocHashIdPoolEx( min, max );
    384 #ifdef CHROMIUM_THREADSAFE
    385382    crInitMutex(&hash->mutex);
    386 #endif
    387383    return hash;
    388384}
     
    400396    if ( !hash) return;
    401397
    402 #ifdef CHROMIUM_THREADSAFE
    403398    crLockMutex(&hash->mutex);
    404 #endif
    405 
    406399    for ( i = 0; i < CR_NUM_BUCKETS; i++ )
    407400    {
     
    424417    }
    425418    crFreeHashIdPool( hash->idPool );
    426 
    427 #ifdef CHROMIUM_THREADSAFE
    428419    crUnlockMutex(&hash->mutex);
    429420    crFreeMutex(&hash->mutex);
    430 #endif
    431 
    432421    crFree( hash );
    433422}
     
    440429    if (!hash) return;
    441430
    442 #ifdef CHROMIUM_THREADSAFE
    443431    crLockMutex(&hash->mutex);
    444 #endif
    445 
    446432    for (i = 0; i < CR_NUM_BUCKETS; i++)
    447433    {
     
    465451    crFreeHashIdPool(hash->idPool);
    466452
    467 #ifdef CHROMIUM_THREADSAFE
    468453    crUnlockMutex(&hash->mutex);
    469454    crFreeMutex(&hash->mutex);
    470 #endif
    471 
    472455    crFree(hash);
    473456}
     
    476459void crHashtableLock(CRHashTable *h)
    477460{
    478 #ifdef CHROMIUM_THREADSAFE
    479     crLockMutex(&h->mutex);
    480 #endif
     461    crLockMutex(&h->mutex);
    481462}
    482463
    483464void crHashtableUnlock(CRHashTable *h)
    484465{
    485 #ifdef CHROMIUM_THREADSAFE
    486     crUnlockMutex(&h->mutex);
    487 #endif
     466    crUnlockMutex(&h->mutex);
    488467}
    489468
     
    513492        return;
    514493
    515 #ifdef CHROMIUM_THREADSAFE
    516494    crLockMutex(&hash->mutex);
    517 #endif
    518495    crHashtableWalkUnlocked(hash, walkFunc , dataPtr2);
    519 #ifdef CHROMIUM_THREADSAFE
    520496    crUnlockMutex(&hash->mutex);
    521 #endif
    522497}
    523498
     
    531506    unsigned int index = crHash(key);
    532507    CRHashNode *node = (CRHashNode *) crCalloc( sizeof( CRHashNode ) );
    533 #ifdef CHROMIUM_THREADSAFE
    534     crLockMutex(&h->mutex);
    535 #endif
     508
     509    crLockMutex(&h->mutex);
    536510    node->key = key;
    537511    node->data = data;
     
    540514    h->num_elements++;
    541515    crHashIdPoolAllocId (h->idPool, key);
    542 #ifdef CHROMIUM_THREADSAFE
    543     crUnlockMutex(&h->mutex);
    544 #endif
     516    crUnlockMutex(&h->mutex);
    545517}
    546518
     
    548520{
    549521    GLboolean fAllocated;
    550 #ifdef CHROMIUM_THREADSAFE
    551     crLockMutex(&h->mutex);
    552 #endif
     522
     523    crLockMutex(&h->mutex);
    553524    fAllocated = crHashIdPoolAllocId (h->idPool, key);
    554 #ifdef CHROMIUM_THREADSAFE
    555     crUnlockMutex(&h->mutex);
    556 #endif
     525    crUnlockMutex(&h->mutex);
    557526    return fAllocated;
    558527}
     
    560529void crHashtableWalkKeys( CRHashTable *h, CRHashIdWalkKeys walkFunc , void *data)
    561530{
    562 #ifdef CHROMIUM_THREADSAFE
    563     crLockMutex(&h->mutex);
    564 #endif
     531    crLockMutex(&h->mutex);
    565532    crHashIdWalkKeys(h->idPool, walkFunc , data);
    566 #ifdef CHROMIUM_THREADSAFE
    567     crUnlockMutex(&h->mutex);
    568 #endif
     533    crUnlockMutex(&h->mutex);
    569534}
    570535
     
    573538    GLuint res;
    574539
    575 #ifdef CHROMIUM_THREADSAFE
    576     crLockMutex(&h->mutex);
    577 #endif
     540    crLockMutex(&h->mutex);
    578541    res = crHashIdPoolAllocBlock (h->idPool, range);
    579542#ifdef DEBUG_misha
     
    588551    }
    589552#endif
    590 #ifdef CHROMIUM_THREADSAFE
    591     crUnlockMutex(&h->mutex);
    592 #endif
     553    crUnlockMutex(&h->mutex);
    593554    return res;
    594555}
     
    599560    CRHashNode *temp, *beftemp = NULL;
    600561
    601 #ifdef CHROMIUM_THREADSAFE
    602     crLockMutex(&h->mutex);
    603 #endif
     562    crLockMutex(&h->mutex);
    604563    for ( temp = h->buckets[index]; temp; temp = temp->next )
    605564    {
     
    623582   
    624583    crHashIdPoolFreeBlock( h->idPool, key, 1 );
    625 #ifdef CHROMIUM_THREADSAFE
    626     crUnlockMutex(&h->mutex);
    627 #endif
     584    crUnlockMutex(&h->mutex);
    628585}
    629586
     
    633590    CRHashNode *temp, *beftemp = NULL;
    634591
    635 #ifdef CHROMIUM_THREADSAFE
    636     crLockMutex(&h->mutex);
    637 #endif
     592    crLockMutex(&h->mutex);
    638593    for (temp = h->buckets[index]; temp; temp = temp->next)
    639594    {
     
    657612
    658613    crHashIdPoolFreeBlock(h->idPool, key, 1);
    659 #ifdef CHROMIUM_THREADSAFE
    660     crUnlockMutex(&h->mutex);
    661 #endif
     614    crUnlockMutex(&h->mutex);
    662615}
    663616
     
    676629    unsigned int index = crHash( key );
    677630    CRHashNode *temp;
    678 #ifdef CHROMIUM_THREADSAFE
     631
    679632    crLockMutex((CRmutex *)&h->mutex);
    680 #endif
    681633    for ( temp = h->buckets[index]; temp; temp = temp->next )
    682634    {
     
    684636            break;
    685637    }
    686 #ifdef CHROMIUM_THREADSAFE
    687638    crUnlockMutex((CRmutex *)&h->mutex);
    688 #endif
    689639    if ( !temp )
    690640    {
     
    699649    unsigned int index = crHash( key );
    700650    CRHashNode *temp;
    701 #ifdef CHROMIUM_THREADSAFE
    702     crLockMutex(&h->mutex);
    703 #endif
     651
     652    crLockMutex(&h->mutex);
    704653    for ( temp = h->buckets[index]; temp; temp = temp->next )
    705654    {
     
    707656            break;
    708657    }
    709 #ifdef CHROMIUM_THREADSAFE
    710     crUnlockMutex(&h->mutex);
    711 #endif
     658    crUnlockMutex(&h->mutex);
    712659    if ( !temp )
    713660    {
     
    715662        return;
    716663    }
    717 #ifdef CHROMIUM_THREADSAFE
    718     crLockMutex(&h->mutex);
    719 #endif
     664    crLockMutex(&h->mutex);
    720665    if ( temp->data && deleteFunc )
    721666    {
     
    723668    }
    724669    temp->data = data;
    725 #ifdef CHROMIUM_THREADSAFE
    726     crUnlockMutex(&h->mutex);
    727 #endif
     670    crUnlockMutex(&h->mutex);
    728671}
    729672
     
    753696        return rc;
    754697
    755 #ifdef CHROMIUM_THREADSAFE
    756698    crLockMutex(&pHash->mutex);
    757 #endif
    758699    for (i = 0; i<CR_NUM_BUCKETS && !rc; i++)
    759700    {
     
    770711        }
    771712    }
    772 #ifdef CHROMIUM_THREADSAFE
     713
    773714    crUnlockMutex(&pHash->mutex);
    774 #endif
    775 
    776715    return rc;
    777716}
  • trunk/src/VBox/GuestHost/OpenGL/util/net.c

    r78190 r78341  
    4848    int                  num_clients; /* total number of clients (unused?) */
    4949
    50 #ifdef CHROMIUM_THREADSAFE
    5150    CRmutex              mutex;
    52 #endif
    5351} cr_net;
    5452
     
    134132    {
    135133        crDebug("crNetConnectToServer() failed, freeing the connection");
    136         #ifdef CHROMIUM_THREADSAFE
    137             crFreeMutex( &conn->messageList.lock );
    138         #endif
     134        crFreeMutex( &conn->messageList.lock );
    139135        conn->Disconnect(conn);
    140136        crFree( conn );
     
    219215{
    220216    conn->Disconnect(conn);
    221     #ifdef CHROMIUM_THREADSAFE
    222         crFreeMutex( &conn->messageList.lock );
    223     #endif
     217    crFreeMutex( &conn->messageList.lock );
    224218    crFree(conn);
    225219}
     
    244238        cr_net.use_hgcm    = 0;
    245239        cr_net.num_clients = 0;
    246 #ifdef CHROMIUM_THREADSAFE
    247240        crInitMutex(&cr_net.mutex);
    248 #endif
    249241
    250242        cr_net.initialized = 1;
     
    305297    if (!cr_net.initialized) return;
    306298
    307 #ifdef CHROMIUM_THREADSAFE
    308299    crLockMutex(&cr_net.mutex);
    309 #endif
    310300
    311301    /* Note, other protocols used by chromium should free up stuff too,
     
    329319    cr_net.initialized = 0;
    330320
    331 #ifdef CHROMIUM_THREADSAFE
    332321    crUnlockMutex(&cr_net.mutex);
    333322    crFreeMutex(&cr_net.mutex);
    334 #endif
    335323}
    336324
     
    380368    list->head = list->tail = NULL;
    381369    list->numMessages = 0;
    382 #ifdef CHROMIUM_THREADSAFE
    383370    crInitMutex(&list->lock);
    384371    crInitCondition(&list->nonEmpty);
    385 #endif
    386372}
    387373
     
    400386    CRMessageListNode *node;
    401387
    402 #ifdef CHROMIUM_THREADSAFE
    403388    crLockMutex(&list->lock);
    404 #endif
    405389
    406390    node = (CRMessageListNode *) crAlloc(sizeof(CRMessageListNode));
     
    419403    list->numMessages++;
    420404
    421 #ifdef CHROMIUM_THREADSAFE
    422405    crSignalCondition(&list->nonEmpty);
    423406    crUnlockMutex(&list->lock);
    424 #endif
    425407}
    426408
     
    437419    int retval;
    438420
    439 #ifdef CHROMIUM_THREADSAFE
    440421    crLockMutex(&list->lock);
    441 #endif
    442422
    443423    if (list->head) {
     
    467447    }
    468448
    469 #ifdef CHROMIUM_THREADSAFE
    470449    crUnlockMutex(&list->lock);
    471 #endif
    472 
    473450    return retval;
    474451}
     
    488465    CRMessageListNode *node;
    489466
    490 #ifdef CHROMIUM_THREADSAFE
    491467    crLockMutex(&list->lock);
    492 #endif
    493 
    494 #ifdef CHROMIUM_THREADSAFE
     468
    495469    while (!list->head) {
    496470        crWaitCondition(&list->nonEmpty, &list->lock);
    497471    }
    498 #else
    499     CRASSERT(list->head);
    500 #endif
    501472
    502473    node = list->head;
     
    518489
    519490    crFree(node);
    520 
    521 #ifdef CHROMIUM_THREADSAFE
    522491    crUnlockMutex(&list->lock);
    523 #endif
    524492}
    525493
     
    653621{
    654622    conn->Disconnect( conn );
    655 #ifdef CHROMIUM_THREADSAFE
    656623    crFreeMutex( &conn->messageList.lock );
    657 #endif
    658624    crFree( conn );
    659625}
  • 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
  • trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu.c

    r78263 r78341  
    466466    if (window && context)
    467467    {
    468 #ifdef CHROMIUM_THREADSAFE
    469468        crSetTSD(&_RenderTSD, context);
    470 #else
    471         render_spu.currentContext = context;
    472 #endif
    473469        context->currentWindow = window;
    474470
     
    509505    {
    510506        renderspu_SystemMakeCurrent( NULL, 0, NULL );
    511 #ifdef CHROMIUM_THREADSAFE
    512507        crSetTSD(&_RenderTSD, NULL);
    513 #else
    514         render_spu.currentContext = NULL;
    515 #endif
    516508    }
    517509    else
  • trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu.h

    r78263 r78341  
    232232    ContextInfo *defaultSharedContext;
    233233
    234 #ifndef CHROMIUM_THREADSAFE
    235     ContextInfo *currentContext;
    236 #endif
    237 
    238234    crOpenGLInterface ws;  /**< Window System interface */
    239235
     
    306302extern uint64_t render_spu_parent_window_id;
    307303
    308 #ifdef CHROMIUM_THREADSAFE
    309304extern CRtsd _RenderTSD;
    310305#define GET_CONTEXT_VAL() ((ContextInfo *) crGetTSD(&_RenderTSD))
     
    312307        crSetTSD(&_RenderTSD, (_v)); \
    313308    } while (0)
    314 #else
    315 #define GET_CONTEXT_VAL() (render_spu.currentContext)
    316 #define SET_CONTEXT_VAL(_v) do { \
    317         render_spu.currentContext = (_v); \
    318     } while (0)
    319 
    320 #endif
    321309
    322310#define GET_CONTEXT(T)  ContextInfo *T = GET_CONTEXT_VAL()
  • trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu_glx.c

    r78251 r78341  
    15721572        if (window->BltInfo.width != w || window->BltInfo.height != h) {
    15731573            /* Only resize if the new dimensions really are different */
    1574 #ifdef CHROMIUM_THREADSAFE
    15751574            ContextInfo *currentContext = (ContextInfo *) crGetTSD(&_RenderTSD);
    1576 #else
    1577             ContextInfo *currentContext = render_spu.currentContext;
    1578 #endif
    15791575            /* Can't resize pbuffers, so destroy it and make a new one */
    15801576            render_spu.ws.glXDestroyPbuffer(window->visual->dpy, window->window);
  • trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu_init.c

    r78263 r78341  
    2828RenderSPU render_spu;
    2929uint64_t render_spu_parent_window_id = 0;
    30 
    31 #ifdef CHROMIUM_THREADSAFE
    3230CRtsd _RenderTSD;
    33 #endif
    3431
    3532#ifdef RT_OS_WINDOWS
     
    151148    self->privatePtr = (void *) &render_spu;
    152149
    153 #ifdef CHROMIUM_THREADSAFE
    154150    crDebug("Render SPU: thread-safe");
    155151    crInitTSD(&_RenderTSD);
    156 #endif
    157152
    158153    crMemZero(&render_spu, sizeof(render_spu));
     
    498493    crUnloadOpenGL();
    499494
    500 #ifdef CHROMIUM_THREADSAFE
    501495    crFreeTSD(&_RenderTSD);
    502 #endif
    503 
    504496    return 1;
    505497}
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