Changeset 44887 in vbox for trunk/src/VBox
- Timestamp:
- Mar 1, 2013 3:20:32 PM (12 years ago)
- svn:sync-xref-src-repo-rev:
- 84055
- Location:
- trunk/src/VBox
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/GuestHost/OpenGL/include/cr_hash.h
r44860 r44887 48 48 DECLEXPORT(GLboolean) crHashtableIsKeyUsed( const CRHashTable *h, GLuint id ); 49 49 DECLEXPORT(void) crHashtableWalk( CRHashTable *hash, CRHashtableWalkCallback walkFunc , void *data); 50 /* walk the hashtable w/o holding the table lock */ 51 DECLEXPORT(void) crHashtableWalkUnlocked( CRHashTable *hash, CRHashtableWalkCallback walkFunc , void *data); 50 52 /*Returns GL_TRUE if given hashtable hold the data, pKey is updated with key value for data in this case*/ 51 53 DECLEXPORT(GLboolean) crHashtableGetDataKey(CRHashTable *pHash, void *pData, unsigned long *pKey); -
trunk/src/VBox/GuestHost/OpenGL/util/hash.c
r44860 r44887 421 421 } 422 422 423 void crHashtableWalk ( CRHashTable *hash, CRHashtableWalkCallback walkFunc , void *dataPtr2)423 void crHashtableWalkUnlocked( CRHashTable *hash, CRHashtableWalkCallback walkFunc , void *dataPtr2) 424 424 { 425 425 int i; 426 426 CRHashNode *entry, *next; 427 427 428 if (!hash)429 return;430 431 #ifdef CHROMIUM_THREADSAFE432 crLockMutex(&hash->mutex);433 #endif434 428 for (i = 0; i < CR_NUM_BUCKETS; i++) 435 429 { … … 445 439 } 446 440 } 441 } 442 443 void crHashtableWalk( CRHashTable *hash, CRHashtableWalkCallback walkFunc , void *dataPtr2) 444 { 445 if (!hash) 446 return; 447 448 #ifdef CHROMIUM_THREADSAFE 449 crLockMutex(&hash->mutex); 450 #endif 451 crHashtableWalkUnlocked(hash, walkFunc , dataPtr2); 447 452 #ifdef CHROMIUM_THREADSAFE 448 453 crUnlockMutex(&hash->mutex); -
trunk/src/VBox/GuestHost/OpenGL/util/util.def
r44766 r44887 83 83 crHashtableNumElements 84 84 crHashtableWalk 85 crHashtableWalkUnlocked 85 86 crHashtableAllocRegisterKey 86 87 crAllocHashtable … … 148 149 crHashtableDeleteBlock 149 150 crHashtableIsKeyUsed 150 crHashtableWalk151 151 crMatrixInit 152 152 crMatrixInitFromString -
trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu.c
r44886 r44887 421 421 showIt = 0; 422 422 else 423 showIt = window->BltInfo.Base.id != CR_RENDER_DEFAULT_WINDOW_ID; 424 423 showIt = (id != CR_RENDER_DEFAULT_WINDOW_ID); 425 424 426 425 /* … … 813 812 crWarning("RTCritSectEnter failed rc %d", rc); 814 813 } 814 } 815 816 static void renderspuVBoxCompositorClearAllCB(unsigned long key, void *data1, void *data2) 817 { 818 WindowInfo *window = (WindowInfo *) data1; 819 renderspuVBoxCompositorSet(window, NULL); 820 } 821 822 void renderspuVBoxCompositorClearAll() 823 { 824 /* we need to clear window compositor, which is not that trivial though, 825 * since the lock order used in presentation thread is compositor lock() -> hash table lock (aquired for id->window resolution) 826 * this is why, to prevent potential deadlocks, we use crHashtableWalkUnlocked that does not hold the table lock 827 * we are can be sure noone will modify the table here since renderspuVBoxCompositorClearAll can be called in the command (hgcm) thread only, 828 * and the table can be modified from that thread only as well */ 829 crHashtableWalkUnlocked(render_spu.windowTable, renderspuVBoxCompositorClearAllCB, NULL); 815 830 } 816 831 -
trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu.h
r44860 r44887 393 393 extern int renderspuCreateFunctions( SPUNamedFunctionTable table[] ); 394 394 extern void renderspuVBoxCompositorSet( WindowInfo *window, struct VBOXVR_SCR_COMPOSITOR * pCompositor); 395 extern void renderspuVBoxCompositorClearAll(); 395 396 extern struct VBOXVR_SCR_COMPOSITOR * renderspuVBoxCompositorAcquire( WindowInfo *window); 396 397 extern int renderspuVBoxCompositorTryAcquire(WindowInfo *window, struct VBOXVR_SCR_COMPOSITOR **ppCompositor); -
trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu_init.c
r44860 r44887 431 431 static int renderSPUCleanup(void) 432 432 { 433 renderspuVBoxCompositorClearAll(); 433 434 crFreeHashtable(render_spu.contextTable, DeleteContextCallback); 434 435 render_spu.contextTable = NULL;
Note:
See TracChangeset
for help on using the changeset viewer.